Flitch

Steps

Every step a workflow can hold, and what each one is for.

Steps run left to right, and a step runs as soon as everything feeding it is ready. A step with two things arriving sees both.

What travels along the lines is rows, documents or links, depending on what produced them. Most steps understand rows only, so the canvas refuses a line that would hand a step something it cannot read, rather than letting the run discover it.

Sources

Where a run gets what it works on. A source has nothing feeding it: it sits alongside the trigger rather than after it, because the trigger says when and the source says what.

StepReads
DatasetRows from your data library
FilesPDFs, images and spreadsheets, either uploaded with the run or kept in a folder
Web pagesLinks to read
APIRows from a web address
CalculationA number from your data model
Input tableRows people keep up to date in a dashboard or app

Dataset has a Make it current first setting worth knowing about. Without it the step reads whatever the last refresh left, which is the right thing most of the time and wrong in one specific case: a workflow on its own timer. A run at 9:05 reads data refreshed at 9:00, or a run at 8:59 reads yesterday's, and which one you get depends on two clocks lining up. Turn it on and the step fetches from the source first and waits for that before reading.

It only applies to a connected dataset. A file or an input table has nothing to re-read. If the refresh fails, the run stops and says so rather than carrying on with older rows, because acting on yesterday's numbers while believing they are today's is worse than a run that did not finish.

Calculation reads a number your data model already defines, instead of working one out again. That is the whole point of it: a workflow that emails "revenue this week" and computes it in a SQL step has no connection to how your dashboards, reports and apps define revenue, so the email and the page can disagree about your own number and nothing anywhere will complain. This reads the same definition they do.

Name the calculation as it appears in your model. Add a column to break it down by and you get a row per value instead of a single figure. The run history records the formula alongside the number, so somebody opening it can see what the figure means.

A calculation here is read as the workflow's owner, which is who every run is authorised and billed as. If row security limits what that person can see, the number reflects their rows.

API is one GET against a public JSON endpoint, so it costs nothing and returns the same columns every time. It reads both shapes real APIs use: a list of objects, and the columnar one where each value is an equal-length array, which is what most time-series APIs return.

Two things it will not do. It does not guess where the rows are in the response, so you name the path, and a response that is not rows at that path is refused with what was found there instead. And it sends no headers, which is where an API key would go: a keyless public endpoint is what this is for, and anything needing a key is a connector. Up to 10,000 rows a call.

An API address is held to the same rule as an outbound webhook. The host is resolved and private, loopback and metadata addresses are refused, on every run rather than when you save it, because a name that resolved publicly yesterday can point somewhere else today. Redirects are not followed.

Files is the one with two modes, and they behave differently. Pointed at a folder, it takes each document once and remembers which it has read, so nothing is processed twice and nothing is missed. Set to take what was sent with the run, it reads whatever somebody attached on the dashboard or app that started it.

Transforms

StepDoes
FilterKeeps only the rows you want
DeduplicateDrops rows that repeat an earlier one
ColumnsKeeps or drops columns
LimitTakes the first or last few rows
Work out a columnA new column from the ones already there
AggregateGroups rows and totals them
Find what is unusualKeeps the rows that do not fit the pattern
ForecastProjects the next few periods
What moves with thisRanks the columns that go with a number
SQLAnything a query can do: lookups, windows over time, reshaping

Find what is unusual is the one to reach for instead of a filter against a number you picked. A threshold set in March is wrong by June, and a number inside a weekly rhythm is ordinary on Tuesday and alarming on Sunday. This takes the trend and the repeating pattern out first, then keeps what is left over.

Tell it which column holds the number, which column says when, and whether to score each branch or product separately. It adds two columns to what it keeps: expected, so an email can say sales were 412 against 180 expected, and deviation, so the worst rows come first. It passes only the unusual rows on by default, which is what pairs with Stop if empty and a send, and it can keep every row marked instead when you want to chart expected against actual.

It needs at least two full cycles of history to know what usual looks like, and says so rather than reporting nothing, since a workflow reads nothing as nothing wrong.

Forecast is the same arithmetic asked the other way round: instead of scoring rows against the pattern, it carries the pattern forward. Tell it the number, the column that says when, how many periods ahead, and whether to project each branch or product separately.

It is the only step that hands on more rows than it was given, because the periods it projects have not happened yet. Those rows get real dates, worked out from the spacing of the ones you already have, written in the same shape the column already used, so a chart reads them as the next few days rather than dropping them. Everything else on a projected row is left empty, because nothing is known about it.

Each projected row carries a low and a high as well as the number. The range comes from how well the method has been fitting your series so far, and it widens the further ahead it goes. A single number with no range invites more confidence than a forecast has earned.

It passes history and forecast on together by default, which is what a chart wants, and a forecast column says which is which. Ask for only the forecast when a step that sends is next, or when somebody wants a list of what is coming.

Held to two full cycles ahead, or thirty periods where there is no pattern. Ask for more and it gives you the limit and says so in the run, rather than extrapolating a shape from a handful of repeats.

What moves with this answers "why is this number what it is" as far as a table can. Give it a number, and it ranks the other columns by how much of that number's variation goes with each of them. It handles both kinds of column: for a number it fits a line, and for a category it compares the averages between groups. Both come back as a share of the same total, so a text column and a numeric one can sit in one ranking.

What comes back is a ranking, not your rows: one row per factor, with how much it moves with the number, which way it goes or which category stands out, and a line you can paste into a message.

This finds what moves together, which is not the same as what causes what. Two columns that both move with your number because a third thing moves all three will both rank well, and nothing here can tell those apart. It also weighs one column at a time, so a column that is really your number in different units will rank first and be perfectly true and no use. Naming the columns to consider is how you keep that out.

It needs at least twelve rows, and it says so rather than ranking a handful of points. It leaves out anything accounting for less than a twentieth of the variation, anything that looks like an id rather than a category, and it refuses outright if the number never varies, since there is nothing to account for.

SQL takes one SELECT. With one line coming in, its rows are the table input. With more, they are d1, d2 and so on, in the order the steps before it run. The SQL follows PostgreSQL, so CTEs, window functions and date functions all work. It reads up to six tables, a query may run for a minute, and it changes nothing: a statement that writes is refused before the run.

A table the assistant drafts from a query can become one of these. Once it is saved, the card offers Keep it current, which makes a workflow that reruns the same query every day and replaces the table. A day whose query returns nothing leaves the table as it was.

AI

One step, and it does whatever you write in its prompt: read a document into rows, judge each row, or write a summary.

Two settings change its shape more than the prompt does:

  • Once per run, or once per item. Per item is a model call and a charge for every row or document, so it is capped. Per run sees everything at once.
  • One result, or a list. A list becomes rows. One result becomes a single record the rest of the workflow can read.

It can also see what it said before. Every run is otherwise amnesiac, so a step asked the same question each week re-lists everything each week, and fifty-two runs are fifty-two unrelated answers rather than a series. Set Remember earlier runs to the last one, two or three, and the answers become a series: "what is new" becomes answerable, and a correction you add to the prompt has something to be a correction of. Off by default, because it spends context on every run and most steps have no use for it. One earlier run answers what is new and three show a trend, which is why it is a count rather than a switch.

You can pick which model each AI step uses, and turn on web search for one that needs to look something up. Reading a document to text is cached on the bytes of the file, so asking again about a document you have already read does not pay to read it twice. Mapping that text into columns is not cached, because that is the part you change while you are getting it right.

Bringing two tables together

StepDoes
JoinMatches two tables on a column
UnionStacks two tables on top of each other

A union where the two sides spell one column differently makes two half-blank columns rather than one, so check the names match. A join keeps every match, so one row on the left matching three on the right is three rows out.

Flow

StepDoes
IfTwo ways out, one condition
RouteSeveral ways out, tried in order
Stop if emptyEnds the run when there is nothing to do
Ask firstWaits for someone to approve before carrying on
Run another workflowHands these rows to one, and waits for it

Stop if empty is worth adding to anything that sends. Without it, a quiet night is an email with no rows in it, and people stop reading the ones that matter. With it, the run ends early and is recorded as a success rather than a failure.

Ask first stops the run where you put it and emails you the question, the rows it was holding, and what approving will do. Press Approve and the run carries on from that step. Press Decline and nothing below it happens.

Put it above anything you want a person to see before it leaves: a send, a webhook, a rewrite of something published.

What it keeps is the point. The run holds the exact table that reached it, so approving sends those rows rather than whatever a fresh run would produce. That matters most with an AI step above the gate, which is usually why somebody wants to approve in the first place: a second run of it would answer differently, and the thing that went out would not be the thing anybody read.

Three things to know about the wait:

  • It gives up after a day by default, and a week at most. Nobody answering is recorded as a run that succeeded having done nothing, the way Stop if empty is, so a quiet week does not switch a scheduled workflow off.
  • Editing the workflow while a run is waiting stops that run rather than resuming it into a graph nobody approved. Run it again.
  • The person who built the workflow is the one asked, since the run is already authorised as them.

The email says what approving does, read from the steps below the gate rather than from the question you typed, so it stays true if you change the workflow later. It gives a count where it can be sure of one. A filter between the gate and the send means the number of rows approved is not the number that will be sent, so it says "one per row" rather than a figure that would be wrong.

Run another workflow is the reuse step. The triggers that follow a workflow chain after one: when A finishes, B starts, and A has no idea B exists. This calls one from the middle of a graph and waits for it, which is what lets one piece of work be shared. One "Clean and validate orders" used by four workflows beats four copies that drift apart.

The rows reaching the step arrive at the other workflow's trigger, so anything the trigger feeds reads them. A workflow built to be reused is therefore one with a trigger and no source of its own. Turn Hand it these rows off for a workflow that reads its own sources and is only being sequenced.

Three things to expect:

  • It runs to the end before this one carries on, and its failure fails this run. The work it did is usually the whole reason the step is there, so a run that reported fine having done none of it would be the worst outcome.
  • It bills its own run to your space, and counts as a run in your monthly allowance. It did run.
  • A workflow that waits for an approval cannot be run this way. Somebody has to answer it and that may be tomorrow, so the step says so rather than timing out.

A workflow cannot run itself, and cannot run one that runs it back. The canvas already refuses a loop inside a single graph; this is the same rule across two, which nothing else was checking.

Sending

StepDoes
EmailSends the rows to people in your space
WebhookPosts the rows to a URL
Send a dashboardEmails a link to one, to people in your space
Send an alertMessages people on WhatsApp, or posts to a Teams or Slack channel

Send an alert is the step for reaching someone outside Flitch, and has its own pages: see Alerts.

Email only ever reaches members of your space. Asked to email each customer their own row, it refuses at run time, so the place to notice is while you are building it. It needs at least one recipient: left blank the step is marked unfinished on the canvas and the run stops there rather than picking somebody.

An email shows the rows as a table by default. Point Body from at a column and that column's text becomes the message instead, which is what you want when an AI step upstream wrote the email. Headings, bulleted and numbered lists, bold, italic, code and links all render, so a briefing a model wrote arrives formatted rather than as one block with the markers still in it. Anything else arrives as it was typed.

For figures, a chart or a layout of your own, press Design the message. The email is then built from blocks, in one of three frames: a note, a card with a header in your space's colour, or a document with a title. See Design the message.

Send a dashboard emails a link rather than rows, to a dashboard, report or app. Any of them can already send itself on a schedule from its own settings, and this is the same email with two differences. It can be conditional: put a Filter and a Stop if empty above it and a quiet week sends nothing, which a scheduler cannot do because it knows nothing about your data. And it is one schedule instead of two, so there is one place to look when something arrives at the wrong time and one thing to turn off.

It needs the one it sends to be published, since what goes out is a link. Put a Publish step above it to send the current version rather than whatever was published last.

Every step here can act once per run or once per row, and they keep a watermark so a nightly send does not send yesterday's rows again. A run that sent some and then failed is reported as partly done rather than failed outright, because nothing sent can be taken back and a retry would send the first ones twice.

A webhook cannot be pointed at a private address. Flitch resolves the host before it calls, and refuses anything inside a private network, including a public name that resolves to one. A refusal never repeats the path, since a webhook address often carries a token there and your run history is readable by your whole space.

Building a report or app

A workflow can also make an artifact, or rewrite one it already made.

StepDoes
Build a report or appMakes a new one from what reached here
Update a reportRewrites one this space already has
PublishPuts the current version in front of readers

These are the two most expensive steps there are, by a wide margin. A build takes about 75 seconds and costs roughly what asking for that report yourself costs, so neither is a step to add casually.

Which of the two you want comes down to one question: is it a series, or one living thing?

  • Building is a request queue, or a dated document. A row arrives saying what somebody wants and one gets built, which is why its brief can take a column and why it can run once per row. "A report each week" is fifty-two reports, and each is about the week it was written in.
  • Updating is for the one artifact people keep going back to. It rewrites in place, so the link never changes and a correction has somewhere to live. Once per run, never per row.

What to expect while it happens: the artifact exists immediately and is empty for a minute or two. The link is still worth following, because somebody who does watches it being written.

Publish is the step that pairs with Update. An edit stays in the editor until something republishes, which is deliberate: an edit must not reach a live page before anybody has looked at it. It also means "every Monday, update the board and republish it" was a first half with no second, and this is the second.

It republishes only. Something nobody has published yet needs an address and a decision about who may read it, and those are not choices a workflow should make on your behalf, so publish it once yourself and this will keep it current. Who may read it is never touched.

Two limits worth knowing before you build one:

  • Ten artifacts a run, and it refuses rather than trimming. Ten of a hundred built looks exactly like a run that worked, and the ten cannot be unbuilt while somebody works out what happened.
  • It checks you can pay for the batch first. A build is billed by the turn that runs it, minutes after the step queues it, so the whole lot is refused up front when the balance will not cover them, with how many it could afford. The alternative is finding out from a negative balance.

An artifact built this way cannot carry a workflow of its own. An artifact that ran a workflow could run the one that built it, and that loop crosses two workflows, where the canvas can only see cycles inside one. Add a run control afterwards with the assistant, once you have looked at what was made.

Output

Output is where the result is kept. It writes to a table in your data library, either a new one it makes on its first run or one you point it at, or to an input table so people can correct what the run produced.

Each run says what happens to the rows already in a library table:

ChoiceWhat a run does
Replaces everythingMakes the table again from this run's rows
Updates rows that matchChanges the row a column you name matches, and adds the rest
Adds to what is thereAdds this run's rows, keeping every earlier run's

A new output replaces when everything the workflow reads is a table in your library, as when one layer is built from the one before, so a rerun never stacks a second copy. It adds when the workflow brings in new files, web pages or readings, so each run's rows are kept. An input table only adds, since a run that replaced it would overwrite people's corrections.

Rows a workflow extracts from documents carry which file they came from and when, so a page can show one upload at a time.

On this page