Skip to content

Commit

Permalink
Update-with-start (#702)
Browse files Browse the repository at this point in the history
Update-with-start sends an update request and starts a workflow if necessary. A
`WorkflowIDConflictPolicy` must be specified. If the workflow execution is not running,
then a new workflow execution is started and the update is sent in the first workflow
task. Alternatively, if the specified workflow execution is running then, if the
`WorkflowIDConflictPolicy` is `USE_EXISTING`, the update is issued against the specified
workflow, and if the `WorkflowIDConflictPolicy` is `FAIL`, an error is returned.

To use update-with-start, first create a `WithStartWorkflowOperation`, passing the desired
`WorkflowIDConflictPolicy`. Then, call either `await client.execute_update_with_start_workflow(...)` or
`await client.start_update_with_start_workflow(...)` passing your start operation. As with normal
update calls, these calls will block until the update has reached the `WaitForStage`
specified in the options, or in the case of `execute_update_with_start_workflow` until the
update has completed. Note that this means that the call will not return successfully
until the update has been delivered to a worker.

Use `await start_operation.workflow_handle()` to wait until the workflow has started. Note
that the workflow will not start, and therefore the workflow handle will never become
available, until you have sent the update-with-start request via either
`execute_update_with_start_workflow` or `start_update_with_start_workflow`.
  • Loading branch information
dandavison authored Dec 19, 2024
1 parent 999c8f8 commit 540faeb
Show file tree
Hide file tree
Showing 5 changed files with 1,458 additions and 156 deletions.
Loading

0 comments on commit 540faeb

Please sign in to comment.