Generate flowchart
generate_flowchartUse this when the user wants a flowchart, process diagram, decision tree or workflow chart from a list of steps and decisions, or wants Mermaid flowchart text drawn as an image or PDF. Takes text with one edge per line (A -> B, A -> B: label, Mermaid flowchart syntax) or nodes (id, text, shape: start, end, process, decision, input, document) with edges (from, to, label), plus top-down or left-right direction. Returns the laid-out chart in an interactive widget, layout checks (box overlaps, edge crossings), process checks (unknown ids with the line number, decisions with fewer than two branches, unreachable and dead-end steps), Mermaid text, and SVG, PDF and Mermaid downloads. Limits are 150 nodes and 300 edges. Does not draw swimlanes, org charts, mind maps, sequence diagrams or charts of data; does not save or share charts.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | No | The flowchart as text, one edge per line, e.g. "Start -> Check stock\nCheck stock -> In stock?\nIn stock? -> Ship: yes\nIn stock? -> Reorder: no". Node forms: id[Text] process, id{Question?} decision, id([Text]) start or end, id[/Text/] input or output, id@{ shape: doc, label: "Text" } document. Plain words are a node too. Labels: A -> B: label or A -->|label| B. Mermaid flowchart text works. Leave empty when you give nodes and edges. | |
| edges | No | Arrows between node ids, up to 300, e.g. [{"from":"q","to":"ship","label":"yes"}]. | |
| nodes | No | Nodes, 1 to 150, e.g. [{"id":"s","text":"Start","shape":"start"},{"id":"q","text":"Paid?","shape":"decision"}]. Use with edges instead of text. | |
| title | No | Title shown above the chart and used for file names, up to 80 characters, e.g. "Order handling". | |
| direction | No | Flow direction, e.g. top-down (default) or left-right. | |
| page_size | No | PDF page, e.g. auto (default, page fits the chart at full size), letter or a4 (chart scaled to fit one page). | |
| edge_style | No | Arrow style, e.g. orthogonal (default, right-angle lines) or straight. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| Yes | |||
| size | Yes | ||
| title | Yes | ||
| layers | Yes | ||
| mermaid | No | ||
| overlaps | Yes | ||
| warnings | Yes | ||
| dead_ends | Yes | ||
| direction | Yes | ||
| downloads | Yes | ||
| end_nodes | Yes | ||
| page_size | Yes | ||
| back_edges | Yes | ||
| edge_count | Yes | ||
| edge_style | Yes | ||
| node_count | Yes | ||
| self_loops | Yes | ||
| start_nodes | Yes | ||
| unreachable | Yes | ||
| shape_counts | Yes | ||
| mermaid_lines | Yes | ||
| preview_count | No | ||
| edge_crossings | Yes | ||
| warnings_count | No | ||
| dead_ends_count | No | ||
| end_nodes_count | No | ||
| layer_crossings | Yes | ||
| start_nodes_count | No | ||
| unreachable_count | No | ||
| decisions_missing_branches | Yes | ||
| decisions_missing_branches_count | No |