Documentation
The logic editor
Logic is what happens inside a system: the steps an API, a button or a scheduled job goes through, drawn as boxes and arrows. This page walks through every part of the editor, how to give your logic its inputs, and every node you can use.
What logic is
A logic belongs to one system (or, as a library function, to none). It starts at one starting point, runs steps one after another along the arrows, and ends by answering or returning. Because it is a model, not code, it can be tested in the editor, read as text steps and turned into TypeScript, Python, C#, Java, Go, Kotlin, Swift, Dart, PHP, Ruby, Rust code. Each kind of logic has its own starting point:
The starting point of an API. This logic begins when another system sends a request here. The outputs are the parts of that request: values from the web address, options, extra details and the main information (body).
Example: The web app sends POST /api/v2/login with { "email": "alex@acme.dev", "password": "…" }: that record comes out of Body.
The starting point. This logic begins when the person does something in the app, such as pressing a button or submitting a form. Each output is one piece of information they entered.
Example: When someone submits the login form, their email and password come out of this step, ready to be checked.
The starting point of a reusable piece of logic (a function). The outputs are the values it was given by the step that used it.
Example: A "Price with tax" function starts here with Price = 100 and Tax rate = 0.2 as outputs.
The starting point for work that runs by itself on a schedule, or when a message arrives in a queue, rather than because a person clicked something.
Example: Every night at 2:00, send the daily sales report (schedule "0 2 * * *").
Which kind to choose
When you create logic, you pick its kind in New logic. The kind decides how the logic starts. Ask what starts it: another app calling an API (Endpoint logic), a person doing something in an app (Event / UI action), or other logic that needs the same steps (Function).
Endpoint logic
What a system does when another system calls one of its APIs. It starts from the request and ends by sending the response.
Use it when
- The system provides an API (a provider endpoint) and you want to describe what happens behind it.
- Other apps call it over the network, and the contracts they rely on should be checked against it.
Examples
- POST /api/v2/login: check the password, then return a token
- GET /api/v1/orders/{id}: load the order, or answer 404
Each API has one endpoint logic. Nothing calls it over the network? Use Event / UI action or Function.
Event / UI action
What an app does when a person does something in it, such as pressing a button or submitting a form. Its inputs are what the person entered.
Use it when
- The logic runs in a website or mobile app (a consumer) because of something the user did.
- It usually calls other systems' APIs, then shows the result to the user.
Examples
- Submit login form: send the email and password to Auth Service
- Add to cart: call the cart API, then update the badge
Started by an API call? Use Endpoint logic. Called by other logic? Use Function.
Function
A reusable piece of logic: it takes inputs, returns outputs, and runs inside the logic that calls it (a Call Function step).
Use it when
- The same steps are needed in more than one place: write them once, call them everywhere.
- A calculation or check that needs no API or user action of its own, such as a price, a validation or a format.
- Shared by every system: give it no system, or mark it Library.
Examples
- Price with tax: price and tax rate in, total out
- Validate address: an address in, a list of problems out
It is what an API or a user action does as a whole? Use Endpoint logic or Event / UI action, and call this Function from it.
The kinds work together: a login button's Event / UI action calls Auth Service's login API, whose Endpoint logic checks the password with a Function it shares with the sign-up API.
Your first logic
- New logic on the Logic page (or a system's Logic tab). Pick the kind: Endpoint logic for an API, Event / UI action for something a person does, Function for logic other logic calls (see Which kind to choose). Name it, and list What it takes and What it gives back (you can change both later). Prefer typing? Choose Write as text and write it in FPC: the header says the system and the kind, for example
SYSTEM AuthServiceandON CALL. - The editor opens with a start step, a Return step, and a Next steps list in the corner of the canvas: set what it takes, add a step, try it with Test, save. Click a step in the list to go where it's done; it goes away once all are done, or when you close it.
- Not sure where things are? Take the 1-minute tour from Next steps, from the toolbar's … menu, or from ? in the toolbar, which also opens this guide and the keyboard shortcuts.
The editor at a glance
Five areas. Click one to read about it.
Toolbar
Across the top. On narrow screens the less used buttons move into the More menu; on a phone the bar keeps the name, Undo and Redo, Help, Save and More, and shows the key, the kind, the version and Discuss on a wider screen (on a phone the version is an item of More that opens History).
- Back
- Returns to the system the logic belongs to, or to the Logic list.
- Name, key and version
- The logic's name, its key (for example LOGIC-AUTH-LOGIN-001) and its version. Click the name for Logic settings (name, description and more). "v1.2" means this revision is that named version; "v1.2+" means it has changed since. Click the version to open History.
- Written by an assistant
- Shows when the saved revision is a change your AI assistant drafted and someone accepted. Point at it to see which assistant drafted it, who accepted it and who approved it. It goes away once someone edits the logic by hand. The Logic list can show only these: Written by an assistant.
- Undo / Redo
- Steps back and forward through your edits since the page opened. Ctrl+Z · Ctrl+Shift+Z
- Discuss
- Lists your chat rooms (the logic's system channel first) with a search; pick one to open it with a mention of this logic in the message box. "New chat room…" creates a channel there and opens it.
- Steps / Flowchart
- The switch next to the name: Steps is the canvas you edit, Flowchart shows the same logic as a flowchart (see Flowchart view below). Flowchart is off while you compare with an earlier revision or edit as text: those show on the canvas.
- Code
- Opens or closes the Code panel on the right. Its tabs, Code, Text and Exported, are in its header; it opens on the last one you used. Ctrl+Shift+C
- Test
- Opens or closes the Test tab in the bottom panel.
- More (…)
- History, Where it is used, Copy link (a link to give a teammate), Present (full screen, canvas only, nothing can be edited; a test you ran keeps its playback controls; going to another page ends it), Use other logic… (opens Nodes on Other logic), Duplicate logic, Publish to store (function logic only), Ask your assistant, Is my code in step?, Save as version, this guide, the keyboard shortcuts (or press ?), the 1-minute tour, and Delete. The page's own help is the ? next to its title at the top.
- Save
- Saves your current changes as a new revision. Until you save, your edits are only in this browser: they are kept through a reload or a crash, and opening the logic again asks to restore them (Restore changes, or Discard them). Ctrl+S
Viewing another environment, such as Production (picked in the header), the editor shows the logic at the revision deployed there, read-only. A note under the toolbar names it ("Viewing Production: rev 4 from Orders API 1.2.0, read-only."), with a button to switch back to Development. Logic not in any release running there says "Not deployed in Production"; a release made before releases recorded their logic says "Not recorded for this release"; reusable logic isn't released on its own. Save, Undo and Redo, Duplicate, Save as version, Delete and Ask your assistant… are hidden, and steps can't be added, changed, moved or deleted, with the mouse or the keyboard: Ctrl+S, Delete and the other shortcuts change nothing. Test, the code and the history still work.
When a pull request changes the code that implements this logic but leaves the logic as it was, an amber note under the toolbar says "The code changed but this logic didn’t: check it still says what the code does." It comes from the change impact check your pipeline runs (see Code impact). See the change opens what that pull request affects. Saving the logic again clears the note; if nothing needs to change, Still correct clears it without a new revision.
Canvas
Where you build. Scroll or pinch to zoom, drag empty space to look around.
- Steps (nodes)
- Each box is one step. Drag a node from the Nodes tab onto the canvas, or right-click empty space and choose "Add a step here…".
- Put a step on an arrow
- Hover an arrow (or click it) and press the + in its middle: pick a step and it goes between the two ends, already connected. The steps after it move right to make room. A pasted step goes where it covers no other step.
- Start and Return steps
- The start step's outputs are the logic's inputs and Return's inputs are its return values: + Add input and + Add return value under them add one, and double-clicking a name renames it.
- Arrows (next-step connections)
- White arrow connection points decide the next step: a step runs when the arrow coming into it fires. Steps without arrow connection points (calculation steps, such as Add or Equals) work out their result whenever a connected step needs it.
- Values (data connections)
- Coloured round connection points carry values. Drag from an output to an input of the same type. Drop a connection on empty space to get a list of the nodes that can take it.
- Unconnected inputs
- An input with no connection uses the value typed in Details → Unconnected inputs.
- Select and move
- Click to select, Shift+drag to select several, drag to move. Alt+click a connection point breaks its links.
- Right-click empty space
- Add a step here, Paste, Add sticky note here, Arrange automatically (the next-step path along one straight line, calculations beside the steps they feed; it keeps a zoom where the connection points can be hit, starting at the start step when the whole logic doesn't fit), Snap to grid, Fit to screen, and the logic's settings: Logic settings, Inputs & return values, Links & usage.
- Right-click a node
- What does this step do?, Details, Connect to…, Key step, Duplicate, Copy, Turn into a function, and Delete. The start step also has Edit inputs…, and a Return step Edit return values….
- Sticky notes
- A short note on the canvas that only you see (Only me) or everyone in the project sees (Project): pick one under the text before saving. Add one with the sticky note button under the zoom buttons or Add sticky note here; it is saved at once and never makes the logic unsaved, even while the logic is locked. The fold button turns it into an icon for you alone. Only its author changes it. Not shown in the flowchart view or while comparing revisions.
- Turn into a function
- Moves the selected steps into a new reusable function logic and puts one Call Function step in their place.
Flowchart view
The same logic drawn as a flowchart, easier to read for people who don't build it. Press Flowchart in the toolbar to switch; press it again for the canvas. Nothing about the logic changes.
- Steps
- Each step that runs is a card, from top to bottom in the order the steps run. The main way runs straight down; other ways branch off to its sides, and an arrow that would cross a step goes round it. The card shows the step's name, what kind of step it is and an icon in the colour of its group. The start and the end are rounded.
- Decisions
- A Branch, a Switch and the check of a loop are diamonds. Their arrows say where each answer goes: Yes and No, the cases and Otherwise, Each time and Done. Yes is green and No is red.
- Loops
- The steps inside a loop run under its diamond, and a dashed arrow goes back up to it for the next time round.
- Side by side and Try
- Parallel splits at a bar and its branches join at a second bar before the logic carries on. Try / Catch and Retry are dashed boxes with an arrow for each case: Try, If it fails, Always.
- Values
- Values and Set variable steps are not drawn. The step that uses a value lists it under its name, and a step followed by Set variable says "Then sets …".
- Not connected
- Steps the start never reaches sit in a dashed frame beside the chart.
- Testing
- With the Test tab open, a run shows on the flowchart: the steps that ran carry their step numbers (×3 inside a loop), the current step glows, a step that failed turns red, and the arrows taken are lit. The rest fades. To see the value on each connection, switch to the canvas.
- Changing a step
- Click a step to open it in Details and change its settings there. Adding a step from the Nodes tab goes back to the canvas, where the new step is placed.
Side panel tabs
The tab rail on the left of the canvas. Click a tab to open it, click it again to collapse the panel; drag the panel's edge to resize it. On a phone the panel starts collapsed, so the canvas has the screen. People who can only view logic see Details and Variables, not Nodes.
Nodes
What you can add. The switch at the top picks Steps or Other logic. Steps lists every step you can add, in groups: the contracts this system calls, its resources (databases, queues, external services), then flow control, data, operators, text, objects, lists, validation and utilities. Search at the top (press / to jump there), click or press Enter to add, or drag onto the canvas. The ? on each row opens that node's guide, the same guide you find in the Node reference below.
Nodes → Other logic
Function logic you can reuse here (also … → Use other logic…): this system's functions and the library functions every system shares (marked ★). Each one becomes a Call Function step, and its inputs and outputs become connection points.
Details
Settings of what you selected. With nothing selected: this logic at a glance, with its inputs and return values ready to edit, and its variables and problems. For a node: its label, Key step, its own settings (for example the API to call or the status to answer; for the start step the logic's inputs, for a Return step its return values), typed values for unconnected inputs, the values it had in the last test run, tickets and implementation links. For an arrow or a value connection: where it goes and the value it carried in the last run. Types read in everyday words (Text, Number, Whole number, Yes / No, Date, List of texts): type one of those, or the written form such as string[] or { a: string }. The badge counts the selection.
Variables
Values kept while the logic runs, each with a name, a type and a default. Read them with Get Variable and change them with Set Variable. Useful for counters and totals inside loops. The badge counts the variables.
Inputs and return values
Inputs are what a logic is given when it starts: each one is an output connection point on the start step (On Event, Function Entry or Trigger) and a field in the Test tab. Return values are what it hands back: each one is an input connection point on every Return step. Each has a name, a type, and a lock that masks secret values (such as passwords) in test runs. In a narrow Details panel (on a phone) each type sits under its name. You can set them:
- When you create the logic: the New logic dialog asks for What it takes and What it gives back. Names like password or token get the lock by themselves.
- On the canvas:+ Add input under the start step and + Add return value under Return. Double-click a name on either step to rename it.
- In Details: select the start step or a Return step; with nothing selected, Details lists both. Right-click an empty part of the canvas and choose Details to get there from anywhere.
- From a right-click: the start step's Edit inputs…, a Return step's Edit return values…, or Inputs & return values… on an empty part of the canvas.
The right-click menu of an empty part of the canvas also has Logic settings… (name, description, event name or Library switch; clicking the name in the toolbar opens it too) and Links & usage… (commits, code changes or files that implement the logic, and the flows that run through it).
How to change the inputs, for example to a username and a password
The Test tab shows
{
"input": "string"
}What you want
{
"username": "string",
"password": "string"
}The Test tab only has a field for each input the logic declares, so typing other names into its JSON does nothing. Change the inputs on the start step (the first box on the canvas, for example On Event):
- Double-click
inputon the start step. Its name opens in Details: typeusernameand press Enter. Its connections move along. - Press + Add input under the start step, type
passwordand press Enter. - Keep the type
stringfor both (or use another type from the table below). Click the eye next topasswordto turn it into a lock: its value is masked in test runs. - Connect the new username and password connection points into the next steps.
- Open Test and pick Custom input: its fields already follow the inputs. Type your test values and press Run.
- Save (Ctrl+S).
Return values work the same way: + Add return value under a Return step, or double-click a name on it. Making new logic? Add username and password under What it takes in the New logic dialog instead.
API logic (logic that implements an endpoint) starts at On Request and ends at Return Response. Its inputs are the request (body, path, query and headers) and its answers are the endpoint's responses, so you change them in the endpoint's declaration and the connection points follow. Select On Request or Return Response (or right-click it and choose Inputs… or Responses…) to see them. The Test tab shows the request under body.
Types you can type for an input or return value
| Type | Means |
|---|---|
| string | Text |
| string(email) | An email address (also date, date-time, uuid, uri, password) |
| integer · number | A whole number · any number |
| boolean | Yes / No |
| string[] | A list of texts |
| enum(admin, member) | One of the listed values |
| { name: string, age?: integer } | A record with fields (? marks an optional field) |
Bottom panel tabs
Below the canvas. Click a tab to open the panel, click it again (or ×) to close it, and drag its top edge to resize it. When the canvas is narrow (both side panels open), the tabs wrap onto a second row; on a phone they stay in one row that you swipe sideways. Problems, Test and History are always there; Where used shows as a tab while it is open. The canvas keeps room for the Test tab: when both side panels are open and it would get too narrow, the panel opened before folds away (open it again from its tabs).
Problems
Everything that stops the logic from running (errors, in red) or looks wrong (warnings, in amber): a required input without a value, a step nothing starts, a check or calculation whose answer nothing uses (it never runs, so it is greyed out after a run: wire its answer into a Branch, or into an AND a Branch reads), a type that doesn't match. Each says what is wrong in words, naming the step by its title; hover one to see its code. Click a problem to jump to its node. An arrow that points at a connection point that is gone (the API or function changed) isn't drawn, so its problem has Remove this arrow. While there are errors, no code is generated.
Test
Run the logic right here (Test in the toolbar opens it too). On the left, pick one of its Examples, a test case of a flow that reaches this logic (listed under From flows), or Custom input, then press Run: the run shows at its end, and the canvas (or the flowchart) lights up the path it took, with the number of times it went along each next-step connection (×3 inside a loop), and the value on every connection. Play replays it step by step; the step buttons and ← → move one step. Custom input has a field per input (Form or JSON; they follow the logic's inputs as you change them), Start from copies an example's inputs, and Reset goes back. Run all runs every example and says how many pass. Each example shows Passes, Fails or No output set. A flow's test case fills in what this logic gets in that case (the case's input when the flow starts here, else what the flow's run hands it on the way) and checks nothing here; if the flow stops before it gets here, it says so. Manage… adds and edits them: the inputs and the output they must return (fields left out aren't checked); Save the logic to keep them. Every example runs again after each edit, and one that returns something else is listed in Problems. Contract calls are answered by the other system's logic, by test data or by generated data. A call whose request doesn't match the other system's contract is listed under the result, as a flow run would fail on it; click it to go to that step. In the list of steps, a call that answered with an error shows its status in red, and Error at, above the list, jumps to where the error starts (a call that failed because of one inside it points at the inner one). A flow's Test panel works the same way over its test cases.
The fields come from the logic's inputs: see how to change the inputs.
History
Every saved revision. Compare any revision with your current changes (added, removed and changed steps are coloured on the canvas), restore one (it asks first, saying how many steps replace how many; the restored revision is saved as a new one, so the logic as it was stays in History), or save a revision as a named version. A revision that an assistant wrote says Written by an assistant. When you compare an older revision, Copy changes for your assistant copies the steps that changed since, by key, so the assistant that wrote your code for that revision updates only those steps (see Keeping code in step on the AI assistant docs page). A change your AI assistant drafted opens the same way: on the Drafts page, Open in the logic editor makes it your current changes, compared with the saved revision; adjust it if you like, and Save accepts it as your own revision.
Where used
Opened from … → Where it is used, and shown as a tab while open: the flows, callers, screens, requirements and tickets that use this logic, so you know what a change affects. Event logic also says, under Details, which screens start it.
Code panel
A panel on the right, opened and closed by Code in the toolbar (Ctrl+Shift+C) or the arrow in its header. Its tabs sit in its header: Code, Text and Exported (saved versions of the logic are under History, at the bottom); it opens on the last one you used. The Code tab shows the code generated from your logic, updated as you edit; while the logic has errors, it lists them instead. Drag its left edge to resize it.
- Language
- Pick the language to generate: TypeScript, Python, C#, Java, Go, Kotlin, Swift, Dart, PHP, Ruby, Rust.
- File tabs
- One tab per generated file: the handler, its types, the runtime and the dependencies it needs.
- Linked to the canvas
- Hover a block of code to outline the nodes it came from; select a node to find its code.
- Options (…)
- FDD comments (each block names its node key), Format (TypeScript only) and One file (everything in a single file).
- Download file / Download all
- One file, or the whole package as a zip.
- AI prompts… (in …)
- In the editor's … menu. Copies a prompt for your AI assistant, connected to Rabbinatix: write this logic’s code, bring your code in step with it, change it, suggest improvements, or explain it. Not connected yet: it opens the connect dialog.
- Is my code in step? (in …)
- In the editor's … menu. Paste your copy of the code (or just its header) to see if it still matches this version.
- Verify against test cases
- Runs the generated code against the recorded test cases and shows any difference from the logic.
- Text tab
- The logic as text steps (the Flow Pseudocode format, FPC), from the same model as the generated code, and you can type in it. Its … menu copies them or downloads a .fpc file, for example to paste into an AI assistant. A dot on the tab shows an edit is under way. How to write text steps opens the guide to the syntax in a new tab. The first change starts an edit: problems show at their line as you type, the canvas shows the result (and takes no edits meanwhile), Apply puts it into your current changes (Undo takes it back, Save keeps it) and Cancel drops it; an edit that adds no step reads Ready to apply. Deleting the last RETURN line removes the Return step, and the text then has no RETURN line, as the canvas has no Return step (logic that reaches its end without one returns nothing more). Closing the panel keeps what you typed. Steps you keep keep their keys, so code marked with them stays in step. A name you give a call’s result (SET payment ← CALL …) stays its name in the text; the step is still titled by the call it makes. The header must stay this logic’s: its key, its system and its kind (ON CALL, ON REQUEST or ON EVENT).
- Exported tab
- What was exported and when (code and text steps), comparing two exports, and checking a copy.
Keyboard shortcuts
On a Mac, use ⌘ for Ctrl. Shortcuts are off while you type in a field, except Ctrl+S, which saves what you typed.
| Ctrl+S | Save |
| Ctrl+Z | Undo |
| Ctrl+Shift+Z or Ctrl+Y | Redo |
| Ctrl+C / Ctrl+V | Copy / paste steps |
| Ctrl+D | Duplicate the selection |
| Delete or Backspace | Delete the selected arrow or steps |
| Ctrl+Shift+C | Show or hide the Code panel |
| / | Search the Nodes tab |
| ? | Show these shortcuts |
| F | Fit to screen |
| + / − | Zoom in / out |
| Space, ← → | Quick test: play, step back, step forward |
| Escape | Clear the selection or close what is open |
| In the Nodes tab: ? or F1 | The guide of the highlighted node |
Values, dates and times
What kind of value is it?
Type Of tells you what kind of value arrived. Connect its Type into a Switch with cases such as string, integer and array to handle each kind differently, or into a Log to show it.
| Type | Means |
|---|---|
| string | Text, such as "Alex" or "42" |
| integer | A whole number, such as 42 |
| number | A number with decimals, such as 4.5 |
| boolean | Yes or no (true or false) |
| object | A record with fields, such as { "name": "Alex" } |
| array | A list, such as [1, 2, 3] |
| null | Nothing: the value is missing or empty |
A whole number is integer; Validate Type with number accepts both.
Dates and times
A date is text in the ISO 8601 form, always in UTC: 2026-10-04T09:30:00.000Z. That is what Now gives and what every date node gives back. Date nodes also read 2026-10-04 (midnight UTC), times with an offset such as 2026-10-04T11:30:00+02:00, and numbers of milliseconds since 1 January 1970. Anything else is not a date: To Date answers Valid = no, and the other date nodes stop with INVALID_DATE (catch it with Try).
Add Time and Time Between take a unit: milliseconds, seconds, minutes, hours, days, weeks, months or years (one or many, in any case). Adding a month keeps the day when it can: 31 January plus 1 month is 28 February (29 in a leap year). Time Between counts whole units, so 23 hours is 0 days.
Format Date writes a date with a pattern such as dd/MM/yyyy HH:mm. Its letters:
| Letters | Means | Example |
|---|---|---|
| yyyy · yy | Year | 2026 · 26 |
| MMMM · MMM · MM · M | Month | October · Oct · 10 · 10 |
| dd · d | Day of the month | 04 · 4 |
| EEEE · EEE | Weekday | Sunday · Sun |
| HH · H | Hour, 0–23 | 09 · 9 |
| hh · h · a | Hour, 1–12, and AM / PM | 09 · 9 · AM |
| mm · m | Minute | 05 · 5 |
| ss · s · SSS | Second and millisecond | 07 · 7 · 250 |
| 'text' | Words kept as they are (two quotes for a quote) | 'at' → at |
Any other character is written as is. Put words between quotes: in at the a would become AM or PM.
Custom code
When no node does what you need, add Custom Code: a small function in plain JavaScript that takes inputs and gives back one result. In Details, give it a name, list its inputs (one name: type per line; Types next to the field lists every type you can use), choose the result type and write the code. input holds the inputs; return the result:
// name: initials · inputs: name: string · result: string
return input.name.split(' ').map((w) => w[0]).join('').toUpperCase();In the editor
Test runs and flow runs run your code in a sandbox: it can't see the page, your sign-in or the network, and each call has 200 ms. Treat it as a pure function: the same inputs should always give the same result. If it throws, takes too long or returns something other than the result type, the logic stops with CUSTOM_CODE_ERROR (catch it with Try).
In exported code
The generated code doesn't contain your JavaScript. It calls deps.code.<name>(input), and the CustomCode interface in the deps file lists every function with its types. Pass in your own implementation next to the database and API clients, in TypeScript, Python or C#, using any library you like (bcrypt, a JWT library, your company's SDK). The editor version can be a simple stand-in, for example a fake hash. Verify against test cases replays the results the editor recorded, so it checks the logic around your function, not the function itself.
One name is one function: two Custom Code nodes with the same name must have the same inputs, result and code.
Node reference
All 140 nodes of the Nodes tab. Open one for its example, what it needs, what it gives back and how to connect it. This is the same guide as the on each row of the Nodes tab. Contract calls, database and queue steps appear in the Nodes tab under the names of your own APIs and resources.
