Set Assignee

setAssignee Mutation

Audience: Programmer

Updates or sets the assignee for a running workflow instance using Temporal's synchronous workflow update mechanism.

Arguments

Name
Type
Description

input

SetAssigneeInput!

Input data for setting the workflow assignee

Return Type

SetAssigneeResponse - Contains the updated assignee information for the workflow.

Input Fields

SetAssigneeInput:

Field
Type
Description

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:

Field
Type
Description

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 id field is empty or missing

  • Invalid RunID: When the runID field is empty or missing

  • Invalid 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 assigneeID is not provided (null), the mutation automatically assigns the workflow to the current authenticated user

  • Both id and runID are required to uniquely identify the workflow instance

  • The 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 assignee field contains the user ID string after the update is applied

  • To 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?