Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion apps/docs/content/docs/cli/blocks.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ Reading it for `sim workflows operations apply`:
inputDefinitions the block's inputs by name; one a pair of fields shares (tableId for
tableSelector and manualTableId) is accepted in place of the pair
outputs what it outputs on success; a failed block outputs {"error":"…"}
instead, read on its error path as <name.error>
instead, read on its error path as <name.error> (a Function also
outputs <name.errorMessage>, the thrown message without line or code)
Block settings such as retry are not fields: `sim workflows operations apply --help`.
```

Expand Down
7 changes: 5 additions & 2 deletions apps/docs/content/docs/cli/reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,8 @@ Reading it for `sim workflows operations apply`:
inputDefinitions the block's inputs by name; one a pair of fields shares (tableId for
tableSelector and manualTableId) is accepted in place of the pair
outputs what it outputs on success; a failed block outputs {"error":"…"}
instead, read on its error path as <name.error>
instead, read on its error path as <name.error> (a Function also
outputs <name.errorMessage>, the thrown message without line or code)
Block settings such as retry are not fields: `sim workflows operations apply --help`.
```

Expand Down Expand Up @@ -7802,7 +7803,9 @@ Block settings, beside inputs in an add's or edit's params:
5xx, not when the host does not resolve or refuses the connection; "retry" covers that.
Outputs:
A block that fails outputs {"error":"<message>"}: connect its error handle and read
<name.error> there (without one, the run fails). A Workflow block's result is the child's
<name.error> there (without one, the run fails). A Function's error leads with the line and
code that threw; its <name.errorMessage> is the thrown message alone, the one to reply with.
A Workflow block's result is the child's
output; a child ending in a Response block gives {data, status, headers}, so read
<call.result.data.x>.
```
Expand Down
4 changes: 3 additions & 1 deletion apps/docs/content/docs/cli/workflows.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,9 @@ Block settings, beside inputs in an add's or edit's params:
5xx, not when the host does not resolve or refuses the connection; "retry" covers that.
Outputs:
A block that fails outputs {"error":"<message>"}: connect its error handle and read
<name.error> there (without one, the run fails). A Workflow block's result is the child's
<name.error> there (without one, the run fails). A Function's error leads with the line and
code that threw; its <name.errorMessage> is the thrown message alone, the one to reply with.
A Workflow block's result is the child's
output; a child ending in a Response block gives {data, status, headers}, so read
<call.result.data.x>.
```
Expand Down
5 changes: 5 additions & 0 deletions apps/docs/content/docs/integrations/table.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ Insert a new row into a table. IMPORTANT: You must use the "data" parameter (not

| Parameter | Type | Description |
| --------- | ---- | ----------- |
| `ignoredColumns` | array | Keys of the written data that name no column of the table, which the write dropped. Empty when every key matched a column. |
| `success` | boolean | Whether row was inserted |
| `row` | json | Inserted row data |
| `message` | string | Status message |
Expand All @@ -75,6 +76,7 @@ Insert multiple rows into a table at once (up to 1000 rows)

| Parameter | Type | Description |
| --------- | ---- | ----------- |
| `ignoredColumns` | array | Keys of the written data that name no column of the table, which the write dropped. Empty when every key matched a column. |
| `success` | boolean | Whether rows were inserted |
| `rows` | array | Inserted rows data |
| `insertedCount` | number | Number of rows inserted |
Expand All @@ -100,6 +102,7 @@ Insert or update a row based on unique column constraints. If a row with matchin

| Parameter | Type | Description |
| --------- | ---- | ----------- |
| `ignoredColumns` | array | Keys of the written data that name no column of the table, which the write dropped. Empty when every key matched a column. |
| `success` | boolean | Whether row was upserted |
| `row` | json | Upserted row data |
| `operation` | string | Operation performed: insert or update |
Expand All @@ -125,6 +128,7 @@ Update an existing row in a table. Supports partial updates - only include the f

| Parameter | Type | Description |
| --------- | ---- | ----------- |
| `ignoredColumns` | array | Keys of the written data that name no column of the table, which the write dropped. Empty when every key matched a column. |
| `success` | boolean | Whether row was updated |
| `row` | json | Updated row data |
| `message` | string | Status message |
Expand All @@ -150,6 +154,7 @@ Update multiple rows that match filter criteria. Data is merged with existing ro

| Parameter | Type | Description |
| --------- | ---- | ----------- |
| `ignoredColumns` | array | Keys of the written data that name no column of the table, which the write dropped. Empty when every key matched a column. |
| `success` | boolean | Whether rows were updated |
| `updatedCount` | number | Number of rows updated |
| `updatedRowIds` | array | IDs of updated rows |
Expand Down
2 changes: 2 additions & 0 deletions apps/docs/content/docs/tables/using-in-workflows.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ Use **Get Row by ID** for a point lookup and **Get Schema** for column definitio
}
```

A key that names no column is dropped, and the write still succeeds. Every insert, upsert, and update reports the dropped keys in `<table.ignoredColumns>`, an empty list when every key matched, so a downstream condition can catch a misspelled column. Public v2 API writes reject an unknown column instead.

Upsert requires a unique column. If the table has several, select **Conflict Column** to choose the match target. Unlisted fields remain unchanged in a partial update.

For different results per row, use a sequential Loop and **Update Row by ID**. A filter update applies the same values to every match; with no **Limit**, it walks all matches in batches. The 1,000 maximum applies to an explicitly supplied update limit, not the total for an unlimited filtered update.
Expand Down
9 changes: 9 additions & 0 deletions apps/docs/content/docs/workflows/blocks/function.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,15 @@ The lazy `sim.files` and `sim.values` helpers are available only in JavaScript f

An uncaught error follows the connected error port or fails the run. Catch an error only when your code can return a meaningful recovery result. `console.log()`, `print()`, and ordinary Shell output appear in `stdout` and the run logs.

On the error path, the failed block has two outputs:

| Output | What it is |
| --- | --- |
| `<function.error>` | The message with the line and code that threw: ``Line 4: `throw new Error('invalid phone')` - invalid phone`` |
| `<function.errorMessage>` | The thrown message alone: `invalid phone` |

Use `<function.errorMessage>` in a reply to a caller, such as a Response block's body, so the caller never sees your code. Use `<function.error>` when you need the line to debug. A failure your code did not throw, such as a timeout, has no line, so both hold the same message.

Function uses the workflow's remaining execution time when a deadline exists. Without a workflow deadline, it still has a fallback timeout of 300,000 ms (5 minutes) by default, configurable through `EXECUTION_TIMEOUT_FREE`. An explicit internal timeout can replace that fallback or shorten the workflow budget; it cannot extend the workflow deadline. There is no separate timeout field in the current block editor. Exceeding the budget terminates execution and reports a block error.

## Related docs
Expand Down
7 changes: 7 additions & 0 deletions apps/docs/openapi-v2-resources.json
Original file line number Diff line number Diff line change
Expand Up @@ -32872,6 +32872,13 @@
"required": ["source", "param"],
"additionalProperties": false
},
"errorOutputs": {
"description": "Text outputs the block writes only when it fails into an error edge, beside `error`.",
"type": "array",
"items": {
"type": "string"
}
},
"graph": {
"type": "object",
"properties": {
Expand Down
Loading
Loading