Tutorials
Tutorial: data tables and decision tables
Create a data table, save and read rows from a workflow with the Data step, and build a decision table that picks the approver for a Decision Table step.
On this page
Goal: save every expense claim in a data table, and let a decision table decide who approves it by amount.
You need: Create tables and Edit schema (data.create, data.edit_schema) for data tables, and Edit workflows for business rules and workflows. Owner, Admin and Manager have them.
Time: about 20 minutes. It builds on the approval workflow tutorial, but works with any workflow.
1. Create a data table#
- Go to Build › Data and select New table.
- Enter the Name Expenses and select Create table.
- On the Schema tab, select Add column for each column, then Save changes:
| Name | Type | Required |
|---|---|---|
| Title | Text | yes |
| Amount | Number | yes |
| Status | Text | |
| Approver | Text |
Column keys are made from the names (title, amount, status, approver). The Rows tab shows the data, and Access sets who can see and change it.

2. Save a row from a workflow#
In your workflow, after the trigger, add a Data step:
- Data table: Expenses. Operation: Insert.
- Map the columns: Title =
{{form.title}}, Amount ={{form.amount}}, Status = Pending. - The new row's id is saved as
{{row_id}}.
Later in the workflow, add another Data step with Update, find the row by Row ID {{row_id}}, and set Status to {{outcome}}.
{
"table_id": "<table-id>",
"table_name": "Expenses",
"operation": "insert",
"column_values": { "title": "{{form.title}}", "amount": "{{form.amount}}", "status": "Pending" },
"output_row_id_var": "row_id"
}List reads several rows with filters (for example Status Equals Pending) into {{rows}} and {{row_count}}. Get reads one row into {{row}}.
3. Ask the Agent to add sample rows (optional)#
To try things out, let the built-in Agent fill the table for you. On the Expenses table, open the Agent panel and ask:
The Agent shows a preview of the first rows and the count. Select Confirm to add them. Later you can ask "Delete the sample rows": it lists the rows and asks you to confirm with a red Delete N rows button (over 25 rows, you also type delete N). You need Manage rows on the table. See Using the Agent.
4. Build a decision table#
- Go to Govern › Business rules and select New decision table. Name it Approval policy.
- Under Inputs, select Add input: key
amount, type Number. - Under Outputs, add
approver(Text) andneeds_cfo(Boolean). - Under Rules, select Add rule for each row. Rules run top to bottom, and the first enabled rule whose conditions all match wins:
| Rule | Condition | approver | needs_cfo |
|---|---|---|---|
| Small | amount Less than 500 | team-lead | false |
| Medium | amount Less than 5000 | manager | false |
| Large | (no conditions: catches everything else) | cfo | true |
- Select Test rules, enter an amount of 7500, and check that Large matches. Then Save.

5. Use it in the workflow#
- Add a Decision Table step before the User Task. Choose Approval policy.
- Map the input amount to
{{form.amount}}. - The outputs become variables:
{{approver}},{{needs_cfo}}, and{{rule_label}}(the rule that matched).{{matched}}is false when no rule matched. - Use them downstream. For example, add a Branch by Condition on
{{needs_cfo}}is_true, or save{{approver}}to the row's Approver column.
{
"decision_table_id": "<decision-table-id>",
"decision_table_name": "Approval policy",
"input_mappings": { "amount": "{{form.amount}}" }
}Changing the rules takes effect at once for every workflow that uses the table. There is no draft, so test with Test rules before you save.
What you built#
- A data table that every run writes to and updates.
- A first-match decision table with a catch-all rule, tested in the editor.
- A workflow step that sends values into the table and branches on its answer.
Next steps#
- Data tables and Decision tables.
- Reports: chart the rows in your table.
- The Data and Decision Table steps in the node reference.