Store Workflow Data
How do you keep an invoice after its flow finishes? Define a custom data type and create a record in its collection. A flow result or AI response alone does not store a record.
An invoice’s data shape is custom.invoice. The dataRecord.custom.invoice type adds stored identity and timestamps. Update and delete actions need that identity.
Your records are separate in Development and live. Development node and flow tests use development records. Published runs use live records. Publishing synchronizes schemas without copying rows. A flow can therefore pass Test and find no row live.
Define fields with stable IDs
Section titled “Define fields with stable IDs”In the app: open Workflows → Invoice intake → Data tables → Add data type. Name it Invoice and define fields with Field name, Data type, and Add field. Choose Create. The app generates field IDs from names and types. For the fixture’s exact IDs, use the assistant tools below.
With an assistant: every workflow-scoped tool call carries an explicit workflowId, a positive-integer string. Call workflow_list to find Invoice intake.
{ "limit": 100 }Note Invoice intake’s data.items[].id as <workflowId>. If data.hasMore is true and Invoice intake is absent, find its ID in the app.
List its existing schemas with schema_type_list.
{ "workflowId": "<workflowId>" }Each field entry uses id:type[:display label]. If you omit the display label, it defaults to the ID. If custom.invoice is absent, create its schema and collection with schema_type_create:
{ "workflowId": "<workflowId>", "name": "custom.invoice", "display": "Invoice", "field": [ "invoice_id:text:Invoice ID", "amount:number:Amount", "status:text:Status", "review_needed:boolean:Review needed", "submitted_at:date:Submitted at", "source_event_id:text:Source event ID" ]}Then inspect its fields with data_field_list:
{ "workflowId": "<workflowId>", "type": "custom.invoice" }Before reusing an existing type, check data.fields[].id and compatible type values. If IDs differ, substitute them in every later write. Direct writes use field IDs. Reads and CSV columns use display labels, plus id, created time, and updated time. Do not pass a query result unchanged into a write.
Create and read one invoice
Section titled “Create and read one invoice”In the app: on Store invoice, choose Add action → Create data and select Invoice in Data type. Fill the generated fields using this fixture. Test the development flow, then inspect Data tables → Invoice. Data tables also lets you delete, import CSV, and copy development records to live. It has no form for creating or editing individual records.
With an assistant: create the fixture with data_record_create to get a stored invoice record. Writes require an explicit env.
{ "workflowId": "<workflowId>", "type": "custom.invoice", "env": "dev", "fields": { "invoice_id": "INV-104", "amount": 120, "status": "received", "review_needed": false, "submitted_at": "2026-09-07T14:00:00Z", "source_event_id": "docs-invoice-104" }}Note data.record.id as <recordId>, separate from the business field invoice_id. When writing non-null dates, use valid ISO-8601 strings. Impossible dates are rejected.
Every create inserts a new row. Retries can duplicate Invoice ID or Source event ID. Neither field is unique. A lookup followed by create does not prevent concurrent duplicates.
Search for the invoice with data_record_query and retrieve the stored record by its ID with data_record_get.
{ "workflowId": "<workflowId>", "type": "custom.invoice", "env": "dev", "query": "INV-104", "limit": 50, "offset": 0 }{ "workflowId": "<workflowId>", "type": "custom.invoice", "env": "dev", "recordId": "<recordId>" }Inspect data.totalCount and advance offset for further pages. The page size defaults to 50 and cannot exceed 100. Queries search record IDs, timestamps, and serialized fields for text, ignoring case. It is not a field predicate. Missing, empty, or whitespace-only queries return an unfiltered page. If the record is absent, you get data.record: null.
Patch only the intended fields
Section titled “Patch only the intended fields”When you patch records directly, omitted fields keep their values. null and "" overwrite values. Even {} advances updated time. Update the intended fields with data_record_update and read back the same record from the same store with data_record_get.
{ "workflowId": "<workflowId>", "type": "custom.invoice", "env": "dev", "recordId": "<recordId>", "fields": { "status": "approved" } }Configure a native update
Section titled “Configure a native update”In the app: choose Add action → Update data and select Invoice. Open Data record → Insert dynamic data → Search for data. Select Invoice, filter Source event ID to docs-invoice-104, and take the first item. Enable only Status under Optional inputs and set it to reviewed. The expression supplies a stored record. Confirm only the intended invoice matches. Choose Test action from the node menu and inspect Data tables → Invoice.
With an assistant: find Store invoice with flow_list ({ "workflowId": "<workflowId>" }) and Update data with integration_action_list:
{ "query": "Update data", "integration": "registry_data" }Note Store invoice’s data.items[].id as <flowId> and Update data’s data.items[].key as <componentKey>. Add the action to the flow with node_add:
{ "workflowId": "<workflowId>", "flow": "<flowId>", "node": "registry_data", "key": "<componentKey>" }Note data.nodeId as <nodeId>.
Before configuring properties, set the type with node_prop_set and reread regenerated properties with node_prop_list, expression context with expr_context, and matching records with data_record_query.
{ "workflowId": "<workflowId>", "nodeId": "<nodeId>", "prop": "dataType", "value": "custom.invoice" }{ "workflowId": "<workflowId>", "nodeId": "<nodeId>", "prop": "dataRecord" }{ "workflowId": "<workflowId>", "type": "custom.invoice", "env": "dev", "query": "docs-invoice-104", "limit": 100, "offset": 0 }node_prop_list takes only workflowId and nodeId; expr_context takes the second object. Confirm the collection in data.workflowData. Inspect every query page: advance offset by 100 until you have examined data.totalCount records. Require exactly one row whose Source event ID equals docs-invoice-104, with id equal to <recordId>. Use this expression, referred to below as <invoiceRecordJs>, to select that record.
workflowData("custom.invoice").filter(row => row.sourceEventId === "docs-invoice-104").first()Validation warns that this expression returns custom.invoice while the property expects dataRecord.custom.invoice. The compiler uses the shape name for this search. At runtime, you get stored records with identity. Require no validation errors and verify the returned record ID.
Validate the expression with expr_validate and save it with node_prop_set, each with inline js:
{ "workflowId": "<workflowId>", "nodeId": "<nodeId>", "prop": "dataRecord", "js": "<invoiceRecordJs>" }Enable Status with node_optional_prop_set and set it with node_prop_set:
{ "workflowId": "<workflowId>", "nodeId": "<nodeId>", "prop": "status", "enabled": true }{ "workflowId": "<workflowId>", "nodeId": "<nodeId>", "prop": "status", "value": "reviewed" }Then reread the props with node_prop_list, test the update with run_node (both { "workflowId": "<workflowId>", "nodeId": "<nodeId>" }), and read back the record with data_record_get, using the same arguments as above.
Check data.resolvedConfigs and confirm the saved Status is reviewed. Native updates write every enabled field except undefined. Before testing, disable unwanted fields.
After checking the binding, use .filter(row => row.invoiceId === flow.invoiceId) to select by business ID. Reject an empty Invoice ID. The comparison === "" matches empty fields, !== "" passes missing values, and includes("") matches every text value. .first() selects the earliest match by creation time, then record ID. With no match, it returns null. Equality does not imply uniqueness.
| Action | Empty or missing records | Result |
|---|---|---|
| Get data | Empty, missing, deleted, or wrong collection | null. |
| Update data / Delete data | Empty reference | Fails: Data record is empty — no matching record was found. |
| Update multiple data records | Empty list; duplicate IDs | []; each distinct ID updated once. |
If a record is missing, deleted, or in another collection, multi-update commits none of the batch. Otherwise, it commits the batch. Earlier nodes keep their effects. Before a full rerun, inspect all earlier effects on data and external services. Verify that repetition is safe or choose a smaller scope. Delete returns {id, deleted: true} and removes the row from normal reads. There is no record undo. Workflow restore cannot recover deleted or overwritten rows.
Preserve access when fields change
Section titled “Preserve access when fields change”In the app: choose View data type → Edit data type → Save and apply. Changing labels preserves field IDs and values. It changes query/get keys and CSV headers. Update consumers of the old labels.
With an assistant: changing only the display preserves fields. Supplying field or fromJson replaces the complete field list.
Inspect the schema with schema_type_get, change its display with schema_type_update, then call schema_type_get again and read back the record with data_record_get.
{ "workflowId": "<workflowId>", "name": "custom.invoice" }{ "workflowId": "<workflowId>", "name": "custom.invoice", "display": "Invoices" }On old rows, new fields read as null. Removing a field hides its values. Restoring the same ID with a compatible type exposes them. Changing field types does not convert values. Incompatible values read as null. Changing a custom.* key creates a different collection. Rows stay under the old key. Deleting a type also removes fields referencing it from other types. Recreating it does not restore those fields. Revalidate affected expressions immediately. When a field is removed, .filter() drops its constraint and can retain every row. After removal, .every() returns false.
For moving rows between stores, see Import and Copy Records.