API

Create and monitor a workflow run

Find a workflow, check access, start it, and monitor the resulting run.

Before you start

Prepare a published workflow with safe test inputs. Confirm the actor has View and Run for that exact workflow. A draft or unrelated workflow is not a substitute.

Follow the journey

  1. List workflows and find the intended identifier.
  2. Read the workflow and confirm its current state.
  3. Check the actor's Run access.
  4. Start the workflow using the smallest valid input.
  5. Read the returned run identifier.
  6. Read the run or connect to its server event stream.
  7. Handle waiting, completed, failed, and cancelled states.
  8. Read the final result before starting dependent work.

Reconnect safely

The event stream reports parsed server events. Do not assume historical replay unless the operation says it is available. After a disconnect, read current run state before deciding whether to reconnect.

Handle an uncertain start

Do not submit the same start request blindly after a timeout. Find the run by the safe identifiers available to the journey, inspect its state, and start a new run only when duplicate work is acceptable.

Reference

Use the Workflows and runs API reference for the exact fields, errors, examples, related operations, and lifecycle.

Chat runs with documents

For runKind: "chat", the run input accepts supported attachments with fileName, contentType, and contentBase64.

Validate the limits in Use Chat. A rejected batch creates no partial run. Normal Chat visibility is limited to the creator in the selected tenant.

Pūnaha Docs

Search the guides

Enter at least two characters.

    Product screen

    View the full screenshot