> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# PartyManager::SetWorkMode

> Configures the work mode of the Party library processing task associated with `threadId`.

Configures the work mode of the Party library processing task associated with `threadId`.

## Syntax

```cpp theme={null}
PartyError SetWorkMode(  
    PartyThreadId threadId,  
    PartyWorkMode workMode  
)  
```

### Parameters

**`threadId`**   [PartyThreadId](/services/playfab/multiplayer/networking/reference/enums/partythreadid)

A high-level categorization of the Party library's internal processing task.

**`workMode`**   [PartyWorkMode](/services/playfab/multiplayer/networking/reference/enums/partyworkmode)

The target work mode for the associated processing task.

### Return value

PartyError

`c_partyErrorSuccess` if the call succeeded or an error code otherwise. The human-readable form of the error code can be retrieved via [GetErrorMessage()](/services/playfab/multiplayer/networking/reference/classes/PartyManager/methods/partymanager_geterrormessage).

## Remarks

If the work mode is set as [PartyWorkMode::Automatic](/services/playfab/multiplayer/networking/reference/enums/partyworkmode), the processing task associated with `threadId` is handled internally by the Party library. If the work mode is configured as [PartyWorkMode::Manual](/services/playfab/multiplayer/networking/reference/enums/partyworkmode), the title must instead perform the processing task associated with `threadId` via periodic calls to [DoWork()](/services/playfab/multiplayer/networking/reference/classes/PartyManager/methods/partymanager_dowork). <br /><br /> This method can only be called when the Party library is uninitialized. Calling while initialized will fail and return an error.   <br /><br /> Configuration of the work mode associated with `threadId` persists across subsequent calls to [Cleanup()](/services/playfab/multiplayer/networking/reference/classes/PartyManager/methods/partymanager_cleanup) and [Initialize()](/services/playfab/multiplayer/networking/reference/classes/PartyManager/methods/partymanager_initialize).

## Requirements

**Header:** Party.h

## See also

[PartyManager](/services/playfab/multiplayer/networking/reference/classes/PartyManager/partymanager)\
[PartyManager::GetWorkMode](/services/playfab/multiplayer/networking/reference/classes/PartyManager/methods/partymanager_getworkmode)\
[PartyManager::DoWork](/services/playfab/multiplayer/networking/reference/classes/PartyManager/methods/partymanager_dowork)


## Related topics

- [PartyManager::GetWorkMode](/services/playfab/multiplayer/networking/reference/classes/PartyManager/methods/partymanager_getworkmode.md)
- [PartyWorkMode](/services/playfab/multiplayer/networking/reference/enums/partyworkmode.md)
- [PartyManager::DoWork](/services/playfab/multiplayer/networking/reference/classes/PartyManager/methods/partymanager_dowork.md)
- [PartyThreadId](/services/playfab/multiplayer/networking/reference/enums/partythreadid.md)
- [PlayFab Party Release Notes](/services/playfab/multiplayer/networking/release-notes.md)
