Documentation

How NEXUS works.

Everything here describes the working demo on this site. Start with the quickstart if you want to build something in five minutes.

Concepts

A workflow is a graph of steps joined by connections. It starts at exactly one Trigger. A run sends one record through the graph. Each step reads the record, adds to it, and passes it on through one of its outputs.

Data travels in two kinds: a payload (the record) and a message (a record that also carries a drafted message). Send steps accept only a message, so you cannot send without a draft.

Step types

StepAcceptsOutputsNotes
TriggernoneoutWhere a run starts: a form, email, call, schedule or other event.
FilterpayloadpassLets a record through only when every rule matches. Otherwise the branch stops.
TransformpayloadoutReshapes data with a fixed, safe operation. No custom code runs.
EnrichpayloadoutLooks the record up in the demo CRM and adds company details and a fit score.
AI classifypayloadoutLabels text. In this demo a seeded keyword model stands in for a language model.
Conditionpayloadtrue, falseSends the record down the true or false branch based on your rules.
Human approvalpayloadapproved, rejectedPauses the run until a person approves or rejects. Required before sends and writes.
Draft messagepayloadoutWrites a message from a template and the record. It is a draft until a Send step.
Send messagemessageoutSimulated send of a drafted message. Nothing leaves this demo. Needs approval upstream.
CRM writepayload, messageoutWrites a row to the synthetic CRM, with retries and a dead-letter queue. Needs approval upstream.
Waitpayload, messageoutHolds the run for a while. Time is simulated and compressed in this demo.
Endpayload, messagenoneMarks a finished branch and names the outcome.

How a run works

  1. The workflow is validated. Any error stops the run before it starts.
  2. Steps run in order, left to right, as soon as every connected input is ready. A step with two inputs (like Decide in the lead template) waits for both and merges them.
  3. A Condition sends the record down its true or false output. Steps on the other branch are marked skipped, with the reason.
  4. A Human approval step pauses the run. Approve sends the record down approved, reject down rejected.
  5. Every step adds a trace line with a simulated duration. Time is simulated from a seed, so the same inputs always give the same trace.

Retries and the dead-letter queue

CRM write steps have maxAttempts and backoffMs. A failed attempt waits backoffMs × 2^(attempt-1) and tries again. When attempts run out the record moves to the dead-letter queue. From there you can re-queue it, which in the demo means the simulated outage has cleared.

Workflow JSON

{
  "id": "lead-qualification",
  "version": 3,
  "name": "Lead to meeting",
  "settings": { "seed": 4104 },
  "nodes": [
    { "id": "trigger", "type": "trigger", "label": "Trigger",
      "position": { "x": 0, "y": 160 },
      "config": { "source": "form", "requiredFields": ["name", "email"] } }
  ],
  "edges": [
    { "id": "e1", "source": "trigger", "sourcePort": "out",
      "target": "classify", "targetPort": "in" }
  ]
}

Demo API

All endpoints live under /portfolio/4/api/demo/nexus, return JSON, and are labelled as an illustrative demo.

RouteDoes
GET /templatesAll templates with workflows and scenarios.
POST /validateSchema check plus graph checks for a workflow.
POST /runRuns a workflow on a scenario or your own record. Returns the run.
POST /run/:id/decisionApproves or rejects the waiting step. Send the original inputs plus nodeId and decision.
GET /run/:idReturns a recent run if this server instance still holds it.
POST /draftRenders a message template against a record.
curl -X POST https://fs-portfolio-4-nexus.vercel.app/portfolio/4/api/demo/nexus/draft \
  -H 'content-type: application/json' \
  -d '{"template":"Hi {{name}}, thanks!","record":{"name":"Priya"}}'
Try the live studio