@addai/flows-mcp 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -215,6 +215,22 @@ export const ELEMENT_TYPES = {
215
215
  settings: {}
216
216
  }
217
217
  },
218
+ button: {
219
+ type: 'button',
220
+ label: 'Button',
221
+ description: 'Submit / action button',
222
+ category: 'inputs',
223
+ defaultConfig: {
224
+ buttonText: 'Continue',
225
+ buttonColor: '#3b82f6',
226
+ buttonAlign: 'left',
227
+ buttonAction: 'submit',
228
+ buttonLink: '',
229
+ buttonLinkNewTab: true,
230
+ width: 'full',
231
+ settings: {}
232
+ }
233
+ },
218
234
  // ── DISPLAY ELEMENTS (show content) ───────────────────────────────────────
219
235
  textBlock: {
220
236
  type: 'textBlock',
@@ -313,6 +329,7 @@ export const LOADING_CONFIG_DEFAULTS = {
313
329
  // NODE TYPES
314
330
  // ============================================================================
315
331
  export const NODE_TYPES = {
332
+ // ── TRIGGERS ──────────────────────────────────────────────────────────────
316
333
  trigger: {
317
334
  type: 'trigger',
318
335
  label: 'Webhook Trigger',
@@ -323,7 +340,19 @@ export const NODE_TYPES = {
323
340
  webhookPath: '',
324
341
  method: 'POST',
325
342
  description: 'Receives incoming HTTP requests'
326
- }
343
+ },
344
+ guide: 'Starts the flow when an HTTP request is received at the webhook URL. The request body/query/headers are available as the trigger output. Downstream nodes access trigger data via {{triggerId.body.field}}, {{triggerId.headers.field}}, {{triggerId.query.field}}.',
345
+ outputShape: {
346
+ body: 'Request body (parsed JSON or string)',
347
+ headers: 'Request headers object',
348
+ query: 'URL query parameters object',
349
+ method: 'HTTP method (GET, POST, etc.)',
350
+ url: 'Full request URL'
351
+ },
352
+ tips: [
353
+ 'The webhook URL is auto-generated after the flow is published',
354
+ 'Use respondToWebhook node downstream to send a custom response'
355
+ ]
327
356
  },
328
357
  scheduleTrigger: {
329
358
  type: 'scheduleTrigger',
@@ -338,7 +367,16 @@ export const NODE_TYPES = {
338
367
  cronExpression: '0 * * * *',
339
368
  timezone: 'UTC',
340
369
  enabled: true
341
- }
370
+ },
371
+ guide: 'Triggers the flow on a recurring schedule. Use scheduleType "interval" for simple intervals or "cron" for cron expressions. Output contains the scheduled time.',
372
+ outputShape: {
373
+ scheduledTime: 'ISO timestamp of when the trigger fired',
374
+ scheduleType: 'interval or cron'
375
+ },
376
+ tips: [
377
+ 'intervalUnit options: seconds, minutes, hours, days',
378
+ 'Set enabled: false to pause the schedule without removing it'
379
+ ]
342
380
  },
343
381
  tablesSchedule: {
344
382
  type: 'tablesSchedule',
@@ -368,6 +406,12 @@ export const NODE_TYPES = {
368
406
  syncDirection: 'full',
369
407
  syncScope: 'all',
370
408
  undeletable: true
409
+ },
410
+ guide: 'Runs on a cron schedule and provides context for +Ai Tables operations. Typically created automatically by the Tables product. The schedule object uses cron-style fields.',
411
+ outputShape: {
412
+ scheduledTime: 'ISO timestamp',
413
+ databaseId: 'Target database ID',
414
+ tableId: 'Target table ID'
371
415
  }
372
416
  },
373
417
  tableButton: {
@@ -385,6 +429,13 @@ export const NODE_TYPES = {
385
429
  tableUrl: '',
386
430
  undeletable: true,
387
431
  description: 'Triggers when this button is clicked in the table'
432
+ },
433
+ guide: 'Fires when a user clicks a button column in an +Ai Table. The row data is passed as the trigger output.',
434
+ outputShape: {
435
+ row: 'The full row data object from the table',
436
+ rowId: 'Row ID that was clicked',
437
+ tableId: 'Table ID',
438
+ columnId: 'Button column ID'
388
439
  }
389
440
  },
390
441
  tableActionTrigger: {
@@ -403,6 +454,14 @@ export const NODE_TYPES = {
403
454
  enabledButtons: [],
404
455
  undeletable: true,
405
456
  description: 'Triggers when a table button is clicked'
457
+ },
458
+ guide: 'Alternative table button trigger with database context. Fires for specific enabled buttons within a column.',
459
+ outputShape: {
460
+ row: 'Full row data object',
461
+ rowId: 'Row ID',
462
+ buttonId: 'Clicked button ID',
463
+ databaseId: 'Database ID',
464
+ tableId: 'Table ID'
406
465
  }
407
466
  },
408
467
  batchActionTrigger: {
@@ -423,6 +482,14 @@ export const NODE_TYPES = {
423
482
  actionLabel: '',
424
483
  undeletable: true,
425
484
  description: ''
485
+ },
486
+ guide: 'Fires when a batch or autopilot action runs on table rows. Receives the row data for processing.',
487
+ outputShape: {
488
+ row: 'Current row data object',
489
+ rowId: 'Row ID being processed',
490
+ actionId: 'Batch action ID',
491
+ databaseId: 'Database ID',
492
+ tableId: 'Table ID'
426
493
  }
427
494
  },
428
495
  tableTrigger: {
@@ -440,6 +507,15 @@ export const NODE_TYPES = {
440
507
  enabledTriggerIds: [],
441
508
  undeletable: true,
442
509
  description: 'Responds to table row events'
510
+ },
511
+ guide: 'Fires on row INSERT, UPDATE, or DELETE events in an +Ai Table. Configure enabledEvents to filter which events trigger the flow.',
512
+ outputShape: {
513
+ event: 'Event type: INSERT, UPDATE, or DELETE',
514
+ row: 'Current row data (after change for INSERT/UPDATE)',
515
+ oldRow: 'Previous row data (for UPDATE/DELETE)',
516
+ rowId: 'Row ID',
517
+ databaseId: 'Database ID',
518
+ tableId: 'Table ID'
443
519
  }
444
520
  },
445
521
  emailTrigger: {
@@ -450,6 +526,15 @@ export const NODE_TYPES = {
450
526
  defaultData: {
451
527
  label: 'Email Trigger',
452
528
  description: 'Triggers when an email is sent to this flow'
529
+ },
530
+ guide: 'Starts the flow when an email is received at the flow\'s email address. The email content, sender, subject, and attachments are available as output.',
531
+ outputShape: {
532
+ from: 'Sender email address',
533
+ to: 'Recipient email address',
534
+ subject: 'Email subject line',
535
+ text: 'Plain text body',
536
+ html: 'HTML body',
537
+ attachments: 'Array of attachment objects'
453
538
  }
454
539
  },
455
540
  startForm: {
@@ -470,8 +555,21 @@ export const NODE_TYPES = {
470
555
  submitButtonColor: '#3b82f6'
471
556
  },
472
557
  formSlug: ''
473
- }
558
+ },
559
+ guide: 'Trigger that starts a flow when a user submits a public form. Configure form elements in data.elements (use list_page_elements for available types). Each element needs {id, type, label, ...config}. Submitted values are keyed by element LABEL (not ID) in the output.',
560
+ outputShape: {
561
+ formData: 'Object keyed by element label -> submitted value (e.g. {"Email": "user@example.com", "Name": "John"})',
562
+ urlParams: 'URL query parameters passed to the form URL',
563
+ submittedAt: 'ISO timestamp of submission'
564
+ },
565
+ tips: [
566
+ 'Elements need a unique id (use crypto.randomUUID()), a type, and a label',
567
+ 'Downstream nodes reference submitted data via {{startFormNodeId.formData.Element Label}}',
568
+ 'Display elements (textBlock, image, video) show content but produce no submission data',
569
+ 'The public form URL is available after publishing the flow'
570
+ ]
474
571
  },
572
+ // ── PROCESSING ────────────────────────────────────────────────────────────
475
573
  httpRequest: {
476
574
  type: 'httpRequest',
477
575
  label: 'HTTP Request',
@@ -489,7 +587,24 @@ export const NODE_TYPES = {
489
587
  timeout: 30000,
490
588
  retries: 0,
491
589
  onError: 'stop'
492
- }
590
+ },
591
+ guide: 'Makes HTTP requests to external APIs. URL, headers values, query param values, and body all support {{nodeId.field}} template syntax.\n\nHeaders: [{key: "Authorization", value: "Bearer {{Variables.apiKey}}", enabled: true}].\nQuery params: [{key: "id", value: "{{triggerId.body.userId}}", enabled: true}].\n\nbodyType options: "none", "json", "text", "xml", "form", "file".\n- json/text/xml: set body as a string\n- form: set formFields as [{key, value, type: "text"|"file", enabled: true}]\n- file: set fileBody (variable reference) + fileContentType (MIME type or "auto-detect")\n\nauthentication: {type: "none"|"bearer"|"basic"|"apikey", token?, username?, password?, apiKeyHeader?, apiKeyValue?}.\n\nonError: "stop" (halt flow) or "continue" (proceed with error in output). Set storeHeaders: true to capture response headers.',
592
+ outputShape: {
593
+ status: 'HTTP status code (number, e.g. 200)',
594
+ body: 'Response body (parsed JSON if Content-Type is application/json, otherwise string). For simple JSON, response fields are also spread at root level.',
595
+ headers: 'Response headers object (only if storeHeaders is true)',
596
+ success: 'boolean — true if status 2xx',
597
+ error: 'Error message string (only on failure when onError is "continue")'
598
+ },
599
+ tips: [
600
+ 'URL supports {{nodeId.field}} templates, e.g. "https://api.example.com/users/{{triggerId.body.userId}}"',
601
+ 'For JSON body, set bodyType to "json" and body to a JSON string with {{}} templates inside',
602
+ 'For form data, set bodyType to "form" and formFields as [{key, value, type: "text", enabled: true}]',
603
+ 'Set authentication.type to "bearer" with authentication.token for bearer auth',
604
+ 'Set retries > 0 for automatic retry on failure (max 10)',
605
+ 'Set onError to "continue" if you want to handle errors in downstream nodes instead of stopping the flow',
606
+ 'Set storeHeaders: true to include response headers in output'
607
+ ]
493
608
  },
494
609
  respondToWebhook: {
495
610
  type: 'respondToWebhook',
@@ -503,7 +618,19 @@ export const NODE_TYPES = {
503
618
  bodyType: 'json',
504
619
  headers: [],
505
620
  description: 'Sends a custom response to the webhook caller'
506
- }
621
+ },
622
+ guide: 'Sends a custom HTTP response back to the webhook caller. Only works in flows triggered by a Webhook Trigger. responseBody and headers support {{nodeId.field}} templates. bodyType: "json", "text", "html". Headers format: [{key: "Content-Type", value: "application/json"}].',
623
+ outputShape: {
624
+ success: 'boolean — true if response was sent',
625
+ statusCode: 'The status code that was sent',
626
+ responseBody: 'The response body that was sent',
627
+ skipped: 'true if no webhook connection was available'
628
+ },
629
+ tips: [
630
+ 'Must be used in a flow that starts with a Webhook Trigger',
631
+ 'Can only send one response per webhook request — use the first one in the flow path',
632
+ 'responseBody supports {{}} templates for dynamic responses'
633
+ ]
507
634
  },
508
635
  code: {
509
636
  type: 'code',
@@ -514,10 +641,25 @@ export const NODE_TYPES = {
514
641
  label: 'Code',
515
642
  isAction: true,
516
643
  mode: 'runOnce',
517
- code: '// All upstream data is available via $input\nconst data = $input;\n\nreturn {\n result: data\n};',
644
+ code: '// Access upstream node outputs via $("nodeId")\n// const data = $("previous-node-id");\n\nreturn {\n result: "hello"\n};',
518
645
  itemsPath: '',
519
646
  onError: 'stop'
520
- }
647
+ },
648
+ guide: 'Executes inline JavaScript in a sandbox. TWO MODES:\n\n**runOnce mode:** Code runs once. Available globals:\n- `$("nodeId")` — lookup any upstream node\'s output by its node ID. This is the primary way to access data.\n- `console.log()` — logging\n- `fetch(url, options)` — HTTP requests (localhost/private IPs blocked)\n- Code must `return { key: value }` — returned keys become the node\'s output fields\n\n**runForEachItem mode:** Iterates over an array. Set `itemsPath` to the path within the parent output to the array (e.g. "data.items"). Available globals:\n- `item` — current array element\n- `index` — current array index\n- `$("nodeId")`, `console`, `fetch` — same as runOnce\n- Returns array of results\n\nIMPORTANT: Do NOT use {{}} template syntax in code — that is for config fields only. Use $("nodeId") instead.',
649
+ outputShape: {
650
+ '<user-defined>': 'Whatever keys the code returns are spread into the output. E.g. return {name: "John", age: 30} makes {{codeNodeId.name}} and {{codeNodeId.age}} available downstream.'
651
+ },
652
+ handles: {
653
+ source: [{ id: 'right', description: 'Default output (code result)' }]
654
+ },
655
+ tips: [
656
+ 'Always return an object: return { result: data }',
657
+ 'Use $("nodeId") to access any upstream node\'s output by ID — this is the correct way to get data',
658
+ 'Do NOT use {{}} syntax in code — that is for config fields only',
659
+ 'In runForEachItem mode, item and index are available for the current iteration',
660
+ 'fetch() is available but blocks localhost and private IP ranges',
661
+ 'Example: const userData = $("abc-123-node-id"); return { name: userData.body.name };'
662
+ ]
521
663
  },
522
664
  map: {
523
665
  type: 'map',
@@ -528,8 +670,22 @@ export const NODE_TYPES = {
528
670
  label: 'Map Data',
529
671
  mappings: [],
530
672
  outputFormat: 'object'
531
- }
673
+ },
674
+ guide: 'Transforms data by mapping input expressions to output keys. Each mapping: {id: "<uuid>", inputExpression: "{{nodeId.field}}", outputName: "myKey", transformType: "direct", enabled: true, description: ""}.\n\nTransform types (17): direct, toString, toNumber, toBoolean, toJson, stringify, lowercase, uppercase, trim, length, split, join, extract, replace, template, calculate, custom.\n\nTransform-specific fields:\n- split: set delimiter (e.g. ",")\n- join: set separator (e.g. ", ")\n- extract: set pattern (regex string)\n- replace: set find + replaceWith\n- template: set template (string with {field} placeholders)\n- calculate: set expression (math expression)\n- custom: set customCode (JavaScript code)',
675
+ outputShape: {
676
+ '<outputName>': 'Each mapping produces an output key with the transformed value. E.g. mapping with outputName "email" makes {{mapNodeId.email}} available downstream.',
677
+ '_metadata': '{successfulMappings: string[], failedMappings: array, totalMappings: number}',
678
+ 'transformMode': '"standard", "batch", "merge", or "restructure"'
679
+ },
680
+ tips: [
681
+ 'inputExpression supports {{nodeId.field}} template syntax',
682
+ 'Each mapping needs a unique id (crypto.randomUUID())',
683
+ 'Use "custom" transformType for complex logic — provide JavaScript in customCode',
684
+ 'Set enabled: false to temporarily disable a mapping',
685
+ 'Failed mappings don\'t stop execution — check _metadata.failedMappings'
686
+ ]
532
687
  },
688
+ // ── LOGIC ─────────────────────────────────────────────────────────────────
533
689
  if: {
534
690
  type: 'if',
535
691
  label: 'If Condition',
@@ -539,7 +695,27 @@ export const NODE_TYPES = {
539
695
  label: 'If Condition',
540
696
  conditions: [],
541
697
  conditionLogic: 'and'
542
- }
698
+ },
699
+ guide: 'Branches the flow based on conditions. Each condition: {id: "<uuid>", leftValue: "{{nodeId.field}}", operator: "equals", rightValue: "expected", dataType: "string"}. conditionLogic: "and" (all must match) or "or" (any matches). Connect the "true" handle to the success path and "false" to the fallback path.\n\nOperators (23): equals, not_equals, greater_than, greater_than_or_equal, less_than, less_than_or_equal, contains, not_contains, starts_with, ends_with, matches_regex, is_empty, is_not_empty, is_null, is_not_null, is_true, is_false, in_array, not_in_array, array_contains, array_length, between, custom_expression.\n\ndataType options: auto, string, number, boolean, array, object, date.\n\nFor "between" operator, add range: {min, max}. For "custom_expression" operator, add expression: "JavaScript expression".',
700
+ outputShape: {
701
+ conditionMet: 'boolean — true if conditions passed',
702
+ evaluatedConditions: 'Array of condition results with leftResolved and rightResolved values',
703
+ logicOperator: '"AND" or "OR"'
704
+ },
705
+ handles: {
706
+ source: [
707
+ { id: 'true', description: 'Condition met — all/any conditions passed' },
708
+ { id: 'false', description: 'Condition not met — conditions failed' }
709
+ ]
710
+ },
711
+ tips: [
712
+ 'leftValue and rightValue support {{nodeId.field}} templates',
713
+ 'Use source_handle "true" or "false" when connecting edges from this node',
714
+ 'Use dataType to ensure proper comparison (e.g. "number" for numeric comparisons)',
715
+ 'Unary operators (is_empty, is_not_empty, is_null, is_not_null, is_true, is_false) ignore rightValue',
716
+ 'Use "between" operator with range: {min: "0", max: "100"} for range checks',
717
+ 'Each condition needs a unique id (crypto.randomUUID())'
718
+ ]
543
719
  },
544
720
  switch: {
545
721
  type: 'switch',
@@ -551,7 +727,27 @@ export const NODE_TYPES = {
551
727
  cases: [],
552
728
  mode: 'first',
553
729
  hasDefault: true
554
- }
730
+ },
731
+ guide: 'Multi-path branching. Each case: {id: "case_<timestamp>", label: "Case Name", outputLabel: "case-0", conditions: [{id, leftValue, operator, rightValue, dataType}], logicOperator: "AND", enabled: true}. The outputLabel is used as the source_handle for edges. Mode "first" stops at the first matching case; "all" executes all matching paths. If hasDefault is true, include a "default" handle for when no cases match.\n\nCondition format is identical to the If node (same 23 operators, same dataType options).',
732
+ outputShape: {
733
+ matchedHandles: 'Array of matched case handle IDs (outputLabel values)',
734
+ matchedCaseLabels: 'Array of matched case label strings',
735
+ hasDefault: 'boolean',
736
+ mode: '"first" or "all"'
737
+ },
738
+ handles: {
739
+ source: [
740
+ { id: '<case.outputLabel>', description: 'Each case uses its outputLabel as the handle ID (e.g. "case-0", "case-1")' },
741
+ { id: 'default', description: 'Fallback when no cases match (only if hasDefault is true)' }
742
+ ]
743
+ },
744
+ tips: [
745
+ 'source_handle must match the case\'s outputLabel value (e.g. "case-0")',
746
+ 'Always include a "default" handle path unless you\'re certain all cases are covered',
747
+ 'Cases use the same condition format as If nodes (same 23 operators)',
748
+ 'Set enabled: false on a case to temporarily disable it without removing',
749
+ 'Each case needs a unique id (e.g. "case_" + Date.now()) and outputLabel (e.g. "case-0")'
750
+ ]
555
751
  },
556
752
  wait: {
557
753
  type: 'wait',
@@ -563,7 +759,20 @@ export const NODE_TYPES = {
563
759
  waitType: 'duration',
564
760
  duration: 5,
565
761
  durationUnit: 'seconds'
566
- }
762
+ },
763
+ guide: 'Pauses flow execution. waitType "duration" pauses for a set time (duration + durationUnit). waitType "until" waits until a specific datetime. Waits longer than ~30 seconds persist to database (sets pauseInDatabase: true) and resume automatically later.',
764
+ outputShape: {
765
+ type: '"delay" for duration waits, "until" for datetime waits',
766
+ duration: 'Wait time in milliseconds (for duration type)',
767
+ completedAt: 'ISO timestamp when wait completed (short waits)',
768
+ pauseInDatabase: 'true for long waits (>30s) — flow persisted and resumed later',
769
+ resumeAt: 'ISO timestamp to resume at (long waits)'
770
+ },
771
+ tips: [
772
+ 'durationUnit options: seconds, minutes, hours, days',
773
+ 'Long waits (>30s) are persisted to database — the flow resumes even after server restarts',
774
+ 'In test mode, waits are skipped (output includes skippedWait: true)'
775
+ ]
567
776
  },
568
777
  flow: {
569
778
  type: 'flow',
@@ -576,33 +785,72 @@ export const NODE_TYPES = {
576
785
  flowName: null,
577
786
  waitForCompletion: true,
578
787
  body: '{}'
579
- }
788
+ },
789
+ guide: 'Executes another flow as a sub-flow. Set flowId to the target flow\'s ID. body accepts a JSON string with input data for the child flow (supports {{nodeId.field}} templates). If waitForCompletion is true, this node waits for the child flow to finish and returns its output; if false, it fires and forgets.',
790
+ outputShape: {
791
+ flowId: 'The executed flow\'s ID',
792
+ flowName: 'The executed flow\'s name',
793
+ runId: 'The child flow run ID',
794
+ waitedForCompletion: 'boolean',
795
+ status: '"completed", "triggered", "failed", or "timeout"',
796
+ success: 'boolean',
797
+ outputs: 'Child flow outputs (only when waitedForCompletion is true and status is "completed")'
798
+ },
799
+ tips: [
800
+ 'body supports {{}} templates for passing dynamic data to the child flow',
801
+ 'Set waitForCompletion to false for fire-and-forget execution',
802
+ 'The child flow must have a trigger node to receive the input data'
803
+ ]
580
804
  },
581
805
  goal: {
582
806
  type: 'goal',
583
807
  label: 'Goal',
584
808
  category: 'logic',
585
- description: 'Goal endpoint for subflow or flow',
809
+ description: 'Goal endpoint — marks a successful flow outcome',
586
810
  defaultData: {
587
811
  label: 'Goal',
588
812
  goalName: ''
589
- }
813
+ },
814
+ guide: 'Terminal node that marks a successful flow outcome. Used for analytics tracking and end conditions. Set goalName to identify this goal in stats. When reached, the flow run status is set to "goal" with the goal name recorded.',
815
+ outputShape: {
816
+ goalName: 'The configured goal name',
817
+ isEndNode: 'true',
818
+ endType: '"goal"',
819
+ success: 'true'
820
+ },
821
+ tips: [
822
+ 'Goal nodes have no output handles — they terminate the flow path',
823
+ 'goalName appears in flow stats and outcome breakdowns',
824
+ 'Multiple goal nodes can exist in a flow for different success paths'
825
+ ]
590
826
  },
591
827
  exit: {
592
828
  type: 'exit',
593
829
  label: 'Exit',
594
830
  category: 'logic',
595
- description: 'Exit endpoint for subflow or flow',
831
+ description: 'Exit endpoint — marks an alternative flow outcome',
596
832
  defaultData: {
597
833
  label: 'Exit',
598
834
  exitName: ''
599
- }
835
+ },
836
+ guide: 'Terminal node that marks an alternative (non-success) flow outcome. Used for analytics tracking. Set exitName to identify this exit in stats. Similar to Goal but semantically represents an exit/fallback path.',
837
+ outputShape: {
838
+ exitName: 'The configured exit name',
839
+ isEndNode: 'true',
840
+ endType: '"exit"',
841
+ success: 'false'
842
+ },
843
+ tips: [
844
+ 'Exit nodes have no output handles — they terminate the flow path',
845
+ 'exitName appears in flow stats and outcome breakdowns',
846
+ 'Use Exit for fallback/rejection paths, Goal for success paths'
847
+ ]
600
848
  },
601
849
  review: {
602
850
  type: 'review',
603
851
  label: 'Review',
604
852
  category: 'logic',
605
- description: 'Wait for approval before continuing',
853
+ description: 'Wait for human approval before continuing',
606
854
  defaultData: {
607
855
  label: 'Review',
608
856
  title: 'Review Required',
@@ -612,7 +860,28 @@ export const NODE_TYPES = {
612
860
  { id: 'option_0', label: 'Approve', color: 'green' },
613
861
  { id: 'option_1', label: 'Reject', color: 'red' }
614
862
  ]
615
- }
863
+ },
864
+ guide: 'Pauses the flow and creates a human review task. The flow resumes when a reviewer selects an option.\n\nfields: [{id: "field_<timestamp>", label: "Field Name", value: "{{nodeId.field}}"}] — value supports {{nodeId.field}} templates, resolved before the review task is created. These show contextual data to the reviewer.\n\noptions: [{id: "option_0", label: "Approve", color: "green"}] — each option becomes a source handle. Colors: "green", "red", "blue", "yellow", "orange", "purple", "gray".\n\nConnect edges from each option\'s handle to the appropriate downstream path.',
865
+ outputShape: {
866
+ selectedOption: 'ID of the chosen option (e.g. "option_0")',
867
+ selectedOptionLabel: 'Label of the chosen option (e.g. "Approve")',
868
+ reviewData: 'Object of resolved field values: {fieldLabel: resolvedValue}',
869
+ respondedBy: 'User ID of the reviewer',
870
+ respondedDate: 'ISO timestamp of the response'
871
+ },
872
+ handles: {
873
+ source: [
874
+ { id: 'option_0', description: 'First option (default: Approve)' },
875
+ { id: 'option_1', description: 'Second option (default: Reject)' },
876
+ { id: 'option_N', description: 'Additional options use sequential IDs: option_2, option_3, etc.' }
877
+ ]
878
+ },
879
+ tips: [
880
+ 'source_handle must match the option\'s id (e.g. "option_0" for Approve)',
881
+ 'Field values support {{nodeId.field}} templates for showing dynamic context',
882
+ 'Add more options by extending the options array with sequential IDs',
883
+ 'Review tasks appear in the /reviews page for workspace members'
884
+ ]
616
885
  },
617
886
  page: {
618
887
  type: 'page',
@@ -639,7 +908,28 @@ export const NODE_TYPES = {
639
908
  animation: 'spinner',
640
909
  backgroundColor: '#ffffff'
641
910
  }
642
- }
911
+ },
912
+ guide: 'Pauses the flow and shows a public form page. The flow resumes when the user submits the form.\n\nelements: array of form elements (use list_page_elements for available types). Each element needs {id: "<uuid>", type: "shortText", label: "Field Name", ...config}.\n\nabandonments: [{id, name, delay, delayUnit}] — optional paths that trigger if the user doesn\'t submit within the delay.\n\nSubmission data is keyed by element LABEL (not ID). Downstream nodes reference via {{pageNodeId.submissionData.Element Label}}.\n\npageStyle: controls form appearance. loadingConfig: loading screen shown while the next step processes.',
913
+ outputShape: {
914
+ submissionData: 'Object keyed by element label -> submitted value. E.g. {"Email": "user@example.com", "Full Name": "John Doe"}',
915
+ submittedDate: 'ISO timestamp of form submission',
916
+ status: '"completed" for submission, "abandoned" for abandonment timeout',
917
+ activeHandle: '"right" for submission, or abandonment handle ID'
918
+ },
919
+ handles: {
920
+ source: [
921
+ { id: 'right', description: 'Form submitted successfully' },
922
+ { id: '<abandonment.id>', description: 'Abandonment timeout path (one per abandonment rule)' }
923
+ ]
924
+ },
925
+ tips: [
926
+ 'Use source_handle "right" for the submission path',
927
+ 'Elements need a unique id (crypto.randomUUID()), type, and label at minimum',
928
+ 'Submission data is keyed by LABEL not ID — {{pageNodeId.submissionData.Email}}',
929
+ 'Display elements (textBlock, image, video) show content but produce no submission data',
930
+ 'Default values in elements support {{nodeId.field}} templates for pre-filling from upstream data',
931
+ 'Use list_page_elements to see all available element types and their configurations'
932
+ ]
643
933
  },
644
934
  loop: {
645
935
  type: 'loop',
@@ -651,7 +941,31 @@ export const NODE_TYPES = {
651
941
  arraySources: [''],
652
942
  enableFailRoute: false,
653
943
  description: 'Loop over each item in an array'
654
- }
944
+ },
945
+ guide: 'Iterates over an array. arraySources accepts {{nodeId.fieldName}} references pointing to arrays. The "loop" handle path executes once per item (the current item is available as the loop node\'s output). After all iterations complete, the "done" handle fires. If enableFailRoute is true, failed iterations route to "fail".\n\nDuring each iteration, downstream nodes access:\n- {{loopNodeId.currentItem}} — the current array element\n- {{loopNodeId.currentIndex}} — 0-based iteration index\n- {{loopNodeId.totalItems}} — total count',
946
+ outputShape: {
947
+ items: 'The full resolved array',
948
+ totalItems: 'Total number of items',
949
+ currentItem: 'Current array element (available during each "loop" iteration)',
950
+ currentIndex: 'Current 0-based index (available during each "loop" iteration)',
951
+ loopHandle: '"loop" — the handle ID for per-item execution',
952
+ doneHandle: '"done" — the handle ID for post-completion',
953
+ enableFailRoute: 'boolean'
954
+ },
955
+ handles: {
956
+ source: [
957
+ { id: 'loop', description: 'Executes once per item — currentItem and currentIndex available' },
958
+ { id: 'done', description: 'Fires after all iterations complete' },
959
+ { id: 'fail', description: 'Failed iterations route here (only when enableFailRoute is true)' }
960
+ ]
961
+ },
962
+ tips: [
963
+ 'arraySources uses {{nodeId.field}} syntax, e.g. ["{{httpRequestId.body.data}}"]',
964
+ 'Nodes in the loop body access {{loopNodeId.currentItem}} and {{loopNodeId.currentIndex}}',
965
+ 'After all iterations, "done" handle fires — use this for post-processing',
966
+ 'Enable enableFailRoute to handle iteration errors separately',
967
+ 'Multiple arraySources are supported — they are concatenated into a single array'
968
+ ]
655
969
  },
656
970
  subflow: {
657
971
  type: 'subflow',
@@ -661,7 +975,13 @@ export const NODE_TYPES = {
661
975
  defaultData: {
662
976
  label: 'Subflow',
663
977
  description: 'Group of nodes'
664
- }
978
+ },
979
+ guide: 'Visual grouping node that collapses a set of nodes into a single block on the canvas. Does not affect execution logic — nodes inside execute normally. Used for organization and readability.',
980
+ outputShape: {},
981
+ tips: [
982
+ 'Subflows are purely visual — they don\'t change execution behavior',
983
+ 'Drag nodes into the subflow group on the canvas to add them'
984
+ ]
665
985
  },
666
986
  variable: {
667
987
  type: 'variable',
@@ -677,7 +997,23 @@ export const NODE_TYPES = {
677
997
  value: '',
678
998
  defaultValue: '',
679
999
  variables: []
680
- }
1000
+ },
1001
+ guide: 'Manages flow-level variables that persist across the flow run.\n\naction "create": Creates multiple variables at once using the "variables" array: [{name: "myVar", type: "string", defaultValue: "", isList: false, deduplicate: false}].\naction "update": Modifies a single variable. Set variableName, operator, and value. value supports {{nodeId.field}} templates.\naction "delete": Removes a variable by variableName.\n\nVariable types: string, number, boolean, object.\nString operators: set, concat, append.\nNumber operators: set, add, subtract, multiply, divide.\nList operators (when isList is true): set, push, pop, shift, unshift, concat, unique, reverse, sort.\n\nVariables are referenced in other nodes as {{Variables.varName}}. The create action also accepts defaultValue with {{}} templates.',
1002
+ outputShape: {
1003
+ action: '"create", "update", or "delete"',
1004
+ variableName: 'Name of the variable (update/delete only)',
1005
+ previousValue: 'Value before the change',
1006
+ newValue: 'Value after the change',
1007
+ createdVariables: 'Array of created variable names (create action only)',
1008
+ __updatedVariables: 'Internal: full variables state after change (system use)',
1009
+ __updatedVariablesMeta: 'Internal: variable metadata after change (system use)'
1010
+ },
1011
+ tips: [
1012
+ 'Reference variables in other node config fields as {{Variables.varName}}',
1013
+ 'value supports {{nodeId.field}} templates for dynamic updates',
1014
+ 'Use isList: true for array variables with list-specific operators (push, pop, etc.)',
1015
+ 'Create variables first using the set_variable tool or a Variable node with action "create"'
1016
+ ]
681
1017
  },
682
1018
  splitTest: {
683
1019
  type: 'splitTest',
@@ -690,8 +1026,27 @@ export const NODE_TYPES = {
690
1026
  { id: 'v_0', label: 'Variant A', percentage: 50 },
691
1027
  { id: 'v_1', label: 'Variant B', percentage: 50 }
692
1028
  ]
693
- }
1029
+ },
1030
+ guide: 'Routes traffic randomly based on percentage weights for A/B testing. Each variant has {id, label, percentage}. Percentages must sum to 100. The variant label is used as the source_handle for edges.',
1031
+ outputShape: {
1032
+ selectedHandle: 'The selected variant\'s label (used as handle ID)',
1033
+ selectedLabel: 'The selected variant\'s label',
1034
+ selectedVariantId: 'The selected variant\'s id'
1035
+ },
1036
+ handles: {
1037
+ source: [
1038
+ { id: 'Variant A', description: 'First variant path (50% by default)' },
1039
+ { id: 'Variant B', description: 'Second variant path (50% by default)' }
1040
+ ]
1041
+ },
1042
+ tips: [
1043
+ 'source_handle must match the variant\'s label string (e.g. "Variant A")',
1044
+ 'Percentages must sum to 100',
1045
+ 'Add more variants by extending the variants array',
1046
+ 'Use the split test management tools (create_split_test, etc.) for production A/B testing with version routing'
1047
+ ]
694
1048
  },
1049
+ // ── CUSTOM ────────────────────────────────────────────────────────────────
695
1050
  customNode: {
696
1051
  type: 'customNode',
697
1052
  label: 'Custom Node',
@@ -707,17 +1062,34 @@ export const NODE_TYPES = {
707
1062
  customNodeIcon: null,
708
1063
  customNodeVersion: null,
709
1064
  onError: 'stop'
710
- }
1065
+ },
1066
+ guide: 'Uses a published custom node definition. Set customNodeId to the custom node\'s ID and optionally customVersionId for a specific version.\n\nInput values are configured as additional data properties (matching the custom node\'s input_schema keys). These values support {{nodeId.field}} template syntax and are resolved BEFORE the custom node code runs.\n\nIMPORTANT: Custom node code receives inputs as `inputs.keyName` — NOT $("nodeId"). The $() function is only available in inline Code nodes.\n\nCustom node code also has access to `secrets.keyName` for configured secrets and `fetch()` for HTTP calls.',
1067
+ outputShape: {
1068
+ '<defined by output_schema>': 'Output keys match the custom node\'s output_schema. Each key from the schema is available as {{customNodeId.key}} downstream.'
1069
+ },
1070
+ tips: [
1071
+ 'Custom node code uses inputs.keyName, NOT $("nodeId") — $() is only for inline Code nodes',
1072
+ 'Input values in the flow editor support {{nodeId.field}} templates — they\'re resolved before code runs',
1073
+ 'Set onError to "stop" (halt flow) or "continue" (proceed with error in output)',
1074
+ 'Use list_custom_nodes to see available custom nodes and their input/output schemas'
1075
+ ]
711
1076
  },
1077
+ // ── UTILITY ───────────────────────────────────────────────────────────────
712
1078
  note: {
713
1079
  type: 'note',
714
1080
  label: 'Note',
715
1081
  category: 'utility',
716
- description: 'Add notes to your flow',
1082
+ description: 'Add notes to your flow canvas',
717
1083
  defaultData: {
718
1084
  label: 'Note',
719
1085
  content: ''
720
- }
1086
+ },
1087
+ guide: 'A visual annotation on the canvas. Does not affect execution. Use for documentation, TODOs, or explaining complex flow logic to team members.',
1088
+ outputShape: {},
1089
+ tips: [
1090
+ 'Notes are not connected to the flow — they are visual only',
1091
+ 'Use markdown in the content field for formatting'
1092
+ ]
721
1093
  }
722
1094
  };
723
1095
  //# sourceMappingURL=node-defaults.js.map