Skip to main content
Multi-user activities let you assign a User Activity Node to specific users registered in your tenant. You configure this behavior directly in your agentic workflow code by using the assign_to method on a UserFlow. You start by instantiating the UserFlow class in your flow definition.
Python
After you create the UserFlow, configure user assignment by calling the assign_to method and passing the required parameters.
UserAssignmentPolicy
required
The assignment policy that controls who receives the user activity. Supported options include:
  • UserAssignmentPolicy.FLOW_INITIATOR: Assigns the user flow to the user who initiates the flow. If you do not explicitly set a UserAssignmentPolicy or run the flow in Preview mode, the initiator receives the user flow.
  • UserAssignmentPolicy.USER: Assigns the user flow to one or more users specified in the assignees parameter.
string
An expression that resolves to the user or users who execute the user activity. This parameter is required when you set the policy to UserAssignmentPolicy.USER. You can provide the expression in one of the following forms:
  • A JSON array with a single user ID string. Example: '["123002B12G"]'
  • A flow variable path that references a user. Example: flow.private.employee.manager In this case, manager has the User type.
At runtime, the flow evaluates the expression and assigns the user activity to the resolved user.
Python
Example: The following example demonstrates how you configure multiple user activities within a single flow. One user flow runs under a designated user, while a second user flow runs under the flow initiator.
Python