{"$schema":"https://json-schema.org/draft/2020-12/schema","title":"FlowZap Code Syntax Schema","description":"Machine-readable specification for FlowZap Code DSL - a domain-specific language for creating workflow and sequence diagrams","version":"1.0.0","documentationUrl":"https://flowzap.xyz/flowzap-code","syntax":{"lane":{"pattern":"identifier { # Display Name","description":"Defines a swimlane/participant. The identifier is used for cross-lane references, the display name appears in the UI.","example":"sales { # Sales Team"},"node":{"pattern":"nX: shape label:\"Text\"","description":"Defines a node within a lane. nX is a unique alias (n1, n2, etc.), shape determines the visual, label is the displayed text.","example":"n1: circle label:\"Start Process\""},"edge":{"pattern":"nX.handle(direction) -> nY.handle(direction) [label=\"Text\"]","description":"Connects two nodes. Handles specify connection points, direction controls the arrow path, label is optional edge text.","example":"n1.handle(right) -> n2.handle(left) [label=\"Submit\"]"},"crossLaneEdge":{"pattern":"nX.handle(direction) -> otherLane.nY.handle(direction)","description":"Connects nodes across different lanes using lane prefix.","example":"n2.handle(bottom) -> approval.n1.handle(top) [label=\"Request Approval\"]"}},"shapes":[{"name":"circle","description":"Start/end events, milestones","usage":"n1: circle label:\"Start\""},{"name":"rectangle","description":"Actions, tasks, process steps","usage":"n2: rectangle label:\"Process Order\""},{"name":"diamond","description":"Decision points, conditions, gateways","usage":"n3: diamond label:\"Approved?\""},{"name":"taskbox","description":"Complex tasks with sub-items (use | separator)","usage":"n4: taskbox label:\"Review|Check docs|Verify data\""}],"directions":["left","right","top","bottom"],"rules":["Node IDs (n1, n2, etc.) must be globally unique across ALL lanes","Each lane block must end with a closing brace }","Labels containing spaces or special characters must be quoted","Cross-lane references require the lane identifier prefix (e.g., sales.n1)"],"examples":{"simple":"process { # Simple Process\n  n1: circle label:\"Start\"\n  n2: rectangle label:\"Do Task\"\n  n3: circle label:\"End\"\n  n1.handle(right) -> n2.handle(left)\n  n2.handle(right) -> n3.handle(left)\n}","multiLane":"customer { # Customer\n  n1: circle label:\"Submit Request\"\n  n2: rectangle label:\"Wait for Response\"\n  n1.handle(right) -> n2.handle(left)\n  n1.handle(bottom) -> support.n3.handle(top) [label=\"Request\"]\n}\nsupport { # Support Team\n  n3: rectangle label:\"Review Request\"\n  n4: diamond label:\"Valid?\"\n  n5: rectangle label:\"Process\"\n  n3.handle(right) -> n4.handle(left)\n  n4.handle(right) -> n5.handle(left) [label=\"Yes\"]\n  n5.handle(top) -> customer.n2.handle(bottom) [label=\"Response\"]\n}","withDecision":"workflow { # Approval Workflow\n  n1: circle label:\"Start\"\n  n2: rectangle label:\"Submit Form\"\n  n3: diamond label:\"Manager Approved?\"\n  n4: rectangle label:\"Process Request\"\n  n5: rectangle label:\"Return to Submitter\"\n  n6: circle label:\"End\"\n  n1.handle(right) -> n2.handle(left)\n  n2.handle(right) -> n3.handle(left)\n  n3.handle(right) -> n4.handle(left) [label=\"Yes\"]\n  n3.handle(bottom) -> n5.handle(top) [label=\"No\"]\n  n4.handle(right) -> n6.handle(left)\n  n5.handle(right) -> n2.handle(bottom) [label=\"Revise\"]\n}"},"aiGenerationTips":["Always start with a circle node for the beginning of a process","Use diamond nodes for any yes/no or conditional decisions","Connect nodes in logical flow order (typically left-to-right or top-to-bottom)","Use descriptive labels that explain the action or decision","For multi-lane diagrams, define all lanes first, then add cross-lane connections"]}