Using Tables in Flows
FlowStack Tables integrate directly with both automation engines, allowing you to read, write, update, and delete data from within your workflows.
Flow Builder (Tables Piece)
The Tables piece provides these actions:
Insert Row
Add a new row to a table:
- Add action: Tables → Insert Row
- Select the target table
- Map values for each column from previous steps
Table: Orders
Columns:
- orderId: {{trigger.body.orderId}}
- customer: {{trigger.body.customerName}}
- amount: {{trigger.body.total}}
- status: "New"
Update Row
Update an existing row by ID:
- Add action: Tables → Update Row
- Select the table and specify the row ID
- Set the columns to update
Table: Orders
Row ID: {{steps.findOrder.output.id}}
Update:
- status: "Shipped"
- shippedAt: {{now}}
Search Rows
Query rows with filters:
- Add action: Tables → Search Rows
- Select the table
- Add filter conditions
- Set sort order and limit
Returns an array of matching rows.
Delete Row
Remove a row by ID:
- Add action: Tables → Delete Row
- Select the table
- Specify the row ID
Workflow Builder (HTTP Request or Code Node)
Using HTTP Request Node
Method: POST
URL: https://app.onflowstack.com/api/v1/tables/{{$env.TABLE_ID}}/rows
Headers:
Authorization: Bearer {{$env.FLOWSTACK_API_KEY}}
Content-Type: application/json
Body:
{
"orderId": "{{$json.orderId}}",
"customer": "{{$json.customerName}}",
"amount": {{$json.total}},
"status": "New"
}
Using Code Node
const tableId = $env.TABLE_ID;
const apiKey = $env.FLOWSTACK_API_KEY;
// Insert a row
const response = await fetch(
`https://app.onflowstack.com/api/v1/tables/${tableId}/rows`,
{
method: 'POST',
headers: {
'Authorization': `Bearer ${apiKey}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
orderId: $json.orderId,
customer: $json.customerName,
amount: $json.total,
status: 'New',
}),
}
);
return [{ json: await response.json() }];
Common Patterns
Deduplication
Check if a record exists before processing:
Trigger → Tables: Search Rows (filter: email = trigger.email)
→ Branch: If rows.length > 0
→ Skip (already processed)
Else
→ Process → Tables: Insert Row
Running Counter
Maintain a counter that increments with each run:
Trigger → Tables: Search Rows (filter: key = "daily_count")
→ Tables: Update Row (value = currentValue + 1)
Processing Queue
Use a table as a work queue:
Schedule Trigger (every 5 min)
→ Tables: Search Rows (filter: status = "Pending", limit: 10)
→ Loop Over Items
→ Process Item
→ Tables: Update Row (status = "Completed")