Skip to main content
Render a workflow’s current graph as a Mermaid flowchart TD diagram. Pipe the diagram string to any Mermaid renderer — GitHub, mermaid.live, or the mermaid CLI — to view the workflow.
clay workflows diagram <workflowId>

Arguments

ArgumentDescription
workflowIdWorkflow id, e.g. wf_abc123. Required.

Output

{
  "format": "mermaid",
  "diagram": "flowchart TD\n  ..."
}
FieldTypeDescription
format"mermaid"Always "mermaid".
diagramstringMermaid flowchart TD source for the workflow.
Node shapes encode the node type: trigger uses a stadium, agent a rectangle, tool a rounded box, code a subroutine, conditional a diamond, map/fork/join a hexagon, reduce a cylinder, and collect a circle. Edges leaving a conditional node are labelled with their branch handle.

Errors

CodeExitNotes
validation_error2workflowId argument is required.
not_found6No workflow or snapshot with that id in this workspace.
auth_forbidden3The API key lacks permission for this command.

Examples

clay workflows diagram wf_abc123
clay workflows diagram wf_abc123 | jq -r '.diagram' > workflow.mmd