context.invoke() triggers another workflow run and pauses until the invoked workflow finishes.
The calling workflow resumes once the invoked workflow either succeeds, fails, or is canceled.
Workflows can only invoke other workflows that were served together in the same
serveMany route.
For details, see Invoke other workflows.Arguments
function
required
The workflow definition to invoke.
Must be a workflow exposed under the same
serveMany.any
The payload to send to the invoked workflow.
This value will be set as
context.requestPayload in the invoked workflow.object
Optional HTTP headers to forward to the invoked workflow.
This value will be set as
context.headers in the invoked workflow.string
Override the workflow run ID for the invoked workflow.
Defaults to a new ID if not specified.
number
Number of retry attempts configuration of the invoked workflow.
Defaults to
3. Retries use exponential backoff.number|string
Delay between retries of the invoked workflow.
object
Flow control configuration of the invoked workflow.See Flow Control for details.
Response
any
The response body returned by the invoked workflow.
boolean
true if the invoked workflow completed with failure.boolean
true if the invoked workflow was canceled before completion.