Set Assignee
setAssignee Mutation
Audience: Programmer
Updates or sets the assignee for a running workflow instance using Temporal's synchronous workflow update mechanism.
Arguments
input
SetAssigneeInput!
Input data for setting the workflow assignee
Return Type
SetAssigneeResponse - Contains the updated assignee information for the workflow.
Input Fields
SetAssigneeInput:
id
String!
The unique identifier of the workflow instance
runID
String!
The run ID of the workflow instance
assigneeID
ID
Optional user ID to assign. If null, defaults to the current user
Return Fields
SetAssigneeResponse:
assignee
String!
The ID of the assigned user after the update
Usage Example
Setting a specific assignee
Setting the current user as assignee
JavaScript Example
Error Handling
The mutation will return an error in the following cases:
Invalid ID: When the
idfield is empty or missingInvalid RunID: When the
runIDfield is empty or missingInvalid workflowClient: When the workflow client cannot be obtained for the tenant
Update failure: When the Temporal workflow update operation fails
Error Response Example
Important Notes
This mutation uses Temporal's synchronous workflow update mechanism (
UpdateWorkflow)The update is applied immediately to the running workflow instance
When
assigneeIDis not provided (null), the mutation automatically assigns the workflow to the current authenticated userBoth
idandrunIDare required to uniquely identify the workflow instanceThe workflow must be running and accessible in the Temporal cluster for the update to succeed
This operation updates the workflow's internal state and may trigger workflow logic based on assignee changes
The returned
assigneefield contains the user ID string after the update is appliedTo clear an assignee, you would need to pass an empty string as
assigneeID(though the current implementation defaults to current user when null)
Last updated
Was this helpful?
