CommunityHire an ExpertSign Up
Workflows & AgentsBranch, filter, loop and transform
Workflows

Branch, filter, loop and transform in workflows

Make decisions and repeat work in a Softr workflow: branch on a condition, filter a run, loop over a list of items, and transform data between your steps.

Workflows can make decisions and repeat work. A branch picks a path. A filter stops the run when a condition fails. A loop repeats steps for each item in a list. A transform reshapes data between steps.

To use data from earlier steps in these settings, see Map data between steps.

Branch

The Branches step splits the run into several paths, named A, B, C and so on. Each path starts with its own condition. Every path whose condition is met runs, at the same time as the others. A path whose condition is not met stops there.

  1. Add a Branches step.
  2. Select a path on the canvas, then set its condition, such as category is Billing.
  3. Select Add in the Branches settings to add another path.

The Branches settings: All qualifying branches will run in parallel, then the paths A Billing, outlined, B Technical and C Sales, each Conditional, and Add

The settings of the Billing path: Only continue if... the category of step 2 is Billing

For example, after an AI step sorts a request, send billing requests to Slack, assign technical ones to support, and email the sales lead about the others.

If no condition is met, no path runs. To handle every other case, add a path with the opposite condition. Paths don’t join again: if two paths need the same step, add it to each path.

Combine branches with AI steps to route a run on an AI result. See Route a run with AI.

Filter

The Filter action checks a condition and stops the workflow if the condition is not met. Use it when nothing needs to happen in the “no” case.

For example, a workflow triggers on every new record of a table. Add a Filter at the start that stops the run when the record’s “Status” is not “Ready”. Only “Ready” records continue.

Unlike Branches, Filter doesn’t create paths. It stops the run early. Each path of a Branches step starts with a filter like this one.

Loop

The Bulk actions (Loop) step runs a group of steps once for each item in a list. It needs a Basic plan or higher.

To set up a loop:

  1. Under List to run actions for, pick a list of items, such as the records a Find multiple records step returns.
  2. Add the actions that run once per item inside the loop.
  3. Inside the loop, pick the current item’s fields under the loop step in the variable picker.

After the last item, the workflow continues with the next action after the loop.

A workflow that runs every Monday, finds the unpaid invoices, then runs two steps for each invoice inside a Bulk actions (Loop) step: Format the amount and Email the client. The loop settings are open, with List to run actions for set to the Records of step 2, outlined

For example, find all “Pending” orders, then loop over them and email each customer a status update.

When items fail

A step inside the loop can fail for one item, for example when the item has no record ID. The loop then goes on with the next item.

  • If at least one item runs without a failure, the loop succeeds and the workflow continues after it. The failedIterations output of the loop tells you how many items failed.
  • If every item fails, the loop fails with the message Every iteration of the loop failed (3 of 3). Last error: .... The workflow stops after the loop, and the run counts as failed. You get the failure email, and after 5 failed runs in a row the workflow turns off.
  • To let the workflow go on after a loop where every item failed, turn on Continue on error in the loop settings.

A failure that a path of the failed step handles, such as Continue on error on that step, does not count as a failed item.

When you test the loop in the builder, the test follows the same rule for the items it runs.

Nested loops

Place a Loop inside another Loop when each item of the outer list contains its own list.

For example, you have a list of tasks, and each task has several tags. You want one record per task and tag combination.

Loop Tasks
└── Loop Tags of this Task
        └── Create record (Task + Tag)
└── Mark Task as checked

If a task has 3 tags, the inner loop runs 3 times and creates 3 records for that task. The outer loop then moves on to the next task. You can nest more than two levels.

A loop runs at most 500 times per run. In a test run, it runs 5 times.

Transform data

The Transform data action creates new values with formulas, the same syntax as the formula fields of Softr Databases. See Formula reference. Use it to reshape, calculate or extract data between steps.

For example:

  • Increment a counter: {vote_count} + 1.
  • Get the day of the week from a date: WEEKDAY({submission_date}).
  • Return different values for a condition: IF().

You name each output field yourself, and select Add field to add another. The names become variables in later steps. Select Help me write a formula to let AI write the formula from a description.

The Transform data step Format the amount, with one output field named amount and its Formula outlined: a dollar sign joined to the Amount of the current invoice. Below is Help me write a formula

Transform data or run custom code

Transform dataRun custom code
Best forSimple calculations, text formatting, date operationsComplex logic, JSON parsing, multi-step transformations
SyntaxSoftr formula languageJavaScript or Python
SetupWrite a formulaDefine input variables, write code
PlanAll plansPro plan and higher

For example, an “Upvote” button starts a workflow. Find the record to read its vote_count, use Transform data with {vote_count} + 1, then update the record with the new value.

For logic that these steps cannot express, write it in JavaScript or Python with Run custom code.

Use these docs with your AI tools

An AI agent can read this documentation directly. You do not need an account or an API key. Everything here is public and read-only.

Query these docs via MCP

Recommended

Add this server to Claude, Claude Code, Cursor, Mistral, or any tool that supports MCP. Your agent can then search Softr Documentation documentation and read it in full, instead of answering from memory.

https://docs.softr.io/mcp
  • searchFind the passages that answer a question.
  • fetchRead one page in full, as Markdown.
  • list_pagesSee every page in this documentation.

Query these docs over HTTP

The same tools also work as plain web requests. Use this for scripts, or for any tool that does not support MCP. There is one endpoint per tool. Arguments go in the query string, and the answer comes back as JSON.

https://docs.softr.io/api/docs/search?query=custom+domain

Read the OpenAPI description. It is built from the same definitions as the tools, so it always matches what the endpoints do.

Read these docs as Markdown

Add .md to any page URL to get its Markdown source. You can also send the headerAccept: text/markdown to the page URL itself.

To read the whole documentation in one file, open llms-full.txt. For a short index of every page, open llms.txt.