When to use
- Save a record: a lead from a form, an order from a webhook
- Look something up before deciding what to do next
- Update a row when a status changes
- Go through many rows with a Loop
- Total or join with a SQL query
Operations
Pick the Database store and the Operation. The form shows only the settings that operation uses.
Every value field takes
{{…}} from earlier steps, including {{agent.…}}.
Filter and sort
Find and Update take a filter as a list of conditions on columns. Useeq, ne, gt, gte, lt, lte, in, like and is_null:
truncated is true, more rows match. Pass nextCursor back in a second Find step to read the next page.
SQL
Choose SQL to write the statement yourself, and choose Read or Write mode. Put values in Parameters, not in the text:{{start_1.email}} and 100. The statement itself is never filled in from earlier steps. This keeps a customer’s text from changing what the query does.
Example: save a lead and tell the team
1
Take the lead
A Webhook starts the workflow with a name and an email.
2
Check for a duplicate
A Database step, Find, table
leads, filter {"email": "{{start_1.email}}"}.3
Save it if new
A Condition on
{{database_1.rows.length}}. On the new branch, a Database step, Insert, table leads, with the name and email.When things go wrong
Used as a tool
When an LLM step uses this step as a tool, pin one operation in the step first. The AI then picks the values, never the operation.Settings
Next steps
Database
Tables, the designer and the SQL console.
Loop
Go through the rows a Find returns.
