Workflows: the logic behind every page and route

When a visitor opens a page on a Tessryx site, a workflow decides what they get. It's a list of steps. A step might look up a record or call a service, and the last one puts the page together.

Your AI writes them, and they're meant to be read afterward. Steps never loop back or jump ahead, so you read them in the order they run. When something looks off, open the workflow in Workflow Studio and follow it down.

Try it

A workflow, run step by step

2 steps
  1. loaddatavariables
    get
    'league/standings'
    $standings
    $data_result
  2. rankvariables
    $table
    $standings.teams^(>points)
    $leader
    $table[0].name
  3. final transform
    '<h1>' & $standings.league & '</h1>' &
    '<p>Week ' & $standings.week & ': ' & $leader & ' lead.</p>' &
    '<ol>' & $join($table.('<li>' & name & ' <b>' & points & '</b></li>')) & '</ol>'
Ready

Edit any step, or press Run to watch it go.

Variables so farnone
Output

The output shows up here.

The expressions really run here, on the JSONata library the platform uses, and the steps keep its rules: a step's results are gone when it ends unless a variable keeps them. Records come from a small store in your browser.

How it works

  1. 01

    Steps switch on the blocks they need

    A step uses at most one of each block, from a condition check to a model call. Most steps use one or two.

  2. 02

    Later steps read what earlier ones saved

    A block's result lasts until the end of its step. Anything needed further down is saved under a name, which also shows where each value came from.

  3. 03

    One expression produces the output

    After the last step, a final expression returns the page's HTML or the route's JSON.

  4. 04

    Pages and schedules can share it

    The workflow behind a page can also run on a schedule, or when your AI starts it.

Under the hood

The technical details

steps
An ordered list. Each step runs once, in order; there are no jumps, so the flow can always be read top to bottom.
blocks
A step enables up to one of each block, and they always fire in this order: assert, conditional, loop, api_call, sub_workflow, data, llm, asset, variables.
variables
The only results a later step can see. Everything else a block returns lasts until the end of its own step.
final_transform
The expression whose value is the run's output: a page's HTML or a route's JSON.
A workflow that reads a record and returns part of it
{
  "steps": [
    {
      "name": "load",
      "blocks": ["data", "variables"],
      "data": {
        "operation": "get",
        "datafile": { "language": "jsonata", "source": "'league/standings'" }
      },
      "variables": [
        { "name": "standings", "value": { "language": "jsonata", "source": "$data_result" } }
      ]
    }
  ],
  "final_transform": {
    "language": "jsonata",
    "source": "$standings.teams^(>points).name"
  }
}

More highlights

Give your AI somewhere to build.

Free to start, no credit card. Bring the AI you already use.

Start building for free