|
577 | 577 | "patch": { |
578 | 578 | "operationId": "updateTableColumn", |
579 | 579 | "summary": "Update Column", |
580 | | - "description": "Update a column by name and return the complete resulting table schema.", |
| 580 | + "description": "Update a column by name and return the complete resulting table schema.\n\nA rename follows the column everywhere the table keys by column id — rows, views, workflow-group references. Workflow Table blocks are the exception: their `filter`, `order`, and `data` are authored JSON that names columns by name, and this endpoint never rewrites workflow state. Blocks bound to this table that still name the old column come back in `unmigrated`; edit them (`POST /api/v2/workflows/{workflowId}/operations`) or their next run fails on the old name.", |
581 | 581 | "tags": ["Tables"], |
582 | 582 | "parameters": [ |
583 | 583 | { |
|
605 | 605 | }, |
606 | 606 | "responses": { |
607 | 607 | "200": { |
608 | | - "description": "The updated table columns.", |
| 608 | + "description": "The updated table columns, plus any unmigrated workflow Table blocks.", |
609 | 609 | "headers": { |
610 | 610 | "X-RateLimit-Limit": { |
611 | 611 | "$ref": "#/components/headers/X-RateLimit-Limit" |
|
620 | 620 | "content": { |
621 | 621 | "application/json": { |
622 | 622 | "schema": { |
623 | | - "$ref": "#/components/schemas/V2TableColumnsResponse" |
| 623 | + "$ref": "#/components/schemas/V2UpdateTableColumnResponse" |
624 | 624 | } |
625 | 625 | } |
626 | 626 | } |
|
5640 | 5640 | } |
5641 | 5641 | ] |
5642 | 5642 | }, |
| 5643 | + "V2UnmigratedTableBlockReference": { |
| 5644 | + "type": "object", |
| 5645 | + "properties": { |
| 5646 | + "workflowId": { |
| 5647 | + "type": "string", |
| 5648 | + "description": "Workflow holding the Table block." |
| 5649 | + }, |
| 5650 | + "workflowName": { |
| 5651 | + "type": "string", |
| 5652 | + "description": "Display name of that workflow." |
| 5653 | + }, |
| 5654 | + "blockId": { |
| 5655 | + "type": "string", |
| 5656 | + "description": "Table block whose configuration still names the old column." |
| 5657 | + }, |
| 5658 | + "blockName": { |
| 5659 | + "type": "string", |
| 5660 | + "description": "Display name of that block." |
| 5661 | + }, |
| 5662 | + "fields": { |
| 5663 | + "type": "array", |
| 5664 | + "items": { |
| 5665 | + "type": "string", |
| 5666 | + "enum": ["filter", "order", "data"] |
| 5667 | + }, |
| 5668 | + "description": "Sub-block fields that still reference the old column name." |
| 5669 | + } |
| 5670 | + }, |
| 5671 | + "required": ["workflowId", "workflowName", "blockId", "blockName", "fields"], |
| 5672 | + "additionalProperties": false, |
| 5673 | + "title": "Unmigrated table block reference", |
| 5674 | + "description": "A workflow Table block still configured against a renamed column." |
| 5675 | + }, |
| 5676 | + "V2UpdateTableColumnData": { |
| 5677 | + "type": "object", |
| 5678 | + "properties": { |
| 5679 | + "columns": { |
| 5680 | + "type": "array", |
| 5681 | + "items": { |
| 5682 | + "type": "object", |
| 5683 | + "properties": { |
| 5684 | + "id": { |
| 5685 | + "description": "Stable server-assigned column identifier.", |
| 5686 | + "type": "string" |
| 5687 | + }, |
| 5688 | + "name": { |
| 5689 | + "type": "string", |
| 5690 | + "minLength": 1, |
| 5691 | + "maxLength": 50, |
| 5692 | + "pattern": "^[A-Za-z_][A-Za-z0-9_]*$", |
| 5693 | + "description": "Column name used as the public row-data key." |
| 5694 | + }, |
| 5695 | + "type": { |
| 5696 | + "type": "string", |
| 5697 | + "enum": [ |
| 5698 | + "string", |
| 5699 | + "number", |
| 5700 | + "currency", |
| 5701 | + "boolean", |
| 5702 | + "date", |
| 5703 | + "ttl", |
| 5704 | + "json", |
| 5705 | + "select" |
| 5706 | + ], |
| 5707 | + "description": "Data type of values stored in the column." |
| 5708 | + }, |
| 5709 | + "required": { |
| 5710 | + "default": false, |
| 5711 | + "description": "Whether inserts require a value for this column.", |
| 5712 | + "type": "boolean" |
| 5713 | + }, |
| 5714 | + "unique": { |
| 5715 | + "default": false, |
| 5716 | + "description": "Whether values must be unique across table rows.", |
| 5717 | + "type": "boolean" |
| 5718 | + }, |
| 5719 | + "workflowGroupId": { |
| 5720 | + "description": "Workflow group whose output populates this column.", |
| 5721 | + "type": "string" |
| 5722 | + }, |
| 5723 | + "options": { |
| 5724 | + "description": "Options declared for a select column.", |
| 5725 | + "maxItems": 100, |
| 5726 | + "type": "array", |
| 5727 | + "items": { |
| 5728 | + "type": "object", |
| 5729 | + "properties": { |
| 5730 | + "id": { |
| 5731 | + "type": "string", |
| 5732 | + "minLength": 1, |
| 5733 | + "description": "Stable select-option identifier." |
| 5734 | + }, |
| 5735 | + "name": { |
| 5736 | + "type": "string", |
| 5737 | + "minLength": 1, |
| 5738 | + "maxLength": 100, |
| 5739 | + "description": "Display name of the select option." |
| 5740 | + } |
| 5741 | + }, |
| 5742 | + "required": ["id", "name"], |
| 5743 | + "additionalProperties": false |
| 5744 | + } |
| 5745 | + }, |
| 5746 | + "multiple": { |
| 5747 | + "description": "Whether a select column accepts multiple options.", |
| 5748 | + "type": "boolean" |
| 5749 | + }, |
| 5750 | + "currencyCode": { |
| 5751 | + "description": "ISO 4217 code for a currency column, normalized to uppercase.", |
| 5752 | + "type": "string", |
| 5753 | + "pattern": "^[A-Za-z]{3}$" |
| 5754 | + } |
| 5755 | + }, |
| 5756 | + "required": ["name", "type", "required", "unique"], |
| 5757 | + "additionalProperties": false, |
| 5758 | + "description": "A typed column in a table schema." |
| 5759 | + }, |
| 5760 | + "description": "Current table columns." |
| 5761 | + }, |
| 5762 | + "unmigrated": { |
| 5763 | + "type": "array", |
| 5764 | + "items": { |
| 5765 | + "$ref": "#/components/schemas/V2UnmigratedTableBlockReference" |
| 5766 | + }, |
| 5767 | + "description": "Workflow Table blocks bound to this table whose `filter`, `order`, or `data` still name the column by its previous name. Only populated by a rename; empty otherwise. Workflow state is never rewritten by this endpoint — edit those blocks (`POST /api/v2/workflows/{workflowId}/operations`) or their next run fails on the old name." |
| 5768 | + } |
| 5769 | + }, |
| 5770 | + "required": ["columns", "unmigrated"], |
| 5771 | + "additionalProperties": false, |
| 5772 | + "title": "Update table column data", |
| 5773 | + "description": "The table column list after the update, plus any workflow Table blocks a rename left pointing at the old column name." |
| 5774 | + }, |
| 5775 | + "V2UpdateTableColumnResponse": { |
| 5776 | + "type": "object", |
| 5777 | + "properties": { |
| 5778 | + "data": { |
| 5779 | + "description": "Response data.", |
| 5780 | + "$ref": "#/components/schemas/V2UpdateTableColumnData" |
| 5781 | + } |
| 5782 | + }, |
| 5783 | + "required": ["data"], |
| 5784 | + "additionalProperties": false, |
| 5785 | + "title": "Update table column response", |
| 5786 | + "description": "The table column list after the update, plus workflow Table blocks a rename left on the old column name.", |
| 5787 | + "examples": [ |
| 5788 | + { |
| 5789 | + "data": { |
| 5790 | + "columns": [ |
| 5791 | + { |
| 5792 | + "id": "col_name", |
| 5793 | + "name": "name", |
| 5794 | + "type": "string", |
| 5795 | + "required": true, |
| 5796 | + "unique": false |
| 5797 | + }, |
| 5798 | + { |
| 5799 | + "id": "col_plan", |
| 5800 | + "name": "subscriptionPlan", |
| 5801 | + "type": "string", |
| 5802 | + "required": false, |
| 5803 | + "unique": false |
| 5804 | + } |
| 5805 | + ], |
| 5806 | + "unmigrated": [ |
| 5807 | + { |
| 5808 | + "workflowId": "3b1f7c92-8d4e-4a6b-9c0d-5e2f8a714b36", |
| 5809 | + "workflowName": "Weekly digest", |
| 5810 | + "blockId": "blk_9c1d3f5a7e2b4068a0c2e4f6b8d0f193", |
| 5811 | + "blockName": "Query plans", |
| 5812 | + "fields": ["filter"] |
| 5813 | + } |
| 5814 | + ] |
| 5815 | + } |
| 5816 | + } |
| 5817 | + ] |
| 5818 | + }, |
5643 | 5819 | "UpdateTableColumnRequest": { |
5644 | 5820 | "type": "object", |
5645 | 5821 | "properties": { |
|
7222 | 7398 | } |
7223 | 7399 | }, |
7224 | 7400 | "deploymentMode": { |
7225 | | - "description": "Workflow execution mode.", |
7226 | 7401 | "type": "string", |
7227 | | - "enum": ["live", "deployed"] |
| 7402 | + "enum": ["live", "deployed"], |
| 7403 | + "description": "Which workflow state per-cell runs execute against. `deployed` (the default when a group was created without one) runs the latest active deployment and refuses to run while the workflow is undeployed; `live` runs the editable draft." |
7228 | 7404 | }, |
7229 | 7405 | "autoRun": { |
7230 | 7406 | "description": "Whether the group automatically runs for new rows.", |
7231 | 7407 | "type": "boolean" |
7232 | 7408 | } |
7233 | 7409 | }, |
7234 | | - "required": ["id", "workflowId", "outputs"], |
| 7410 | + "required": ["id", "workflowId", "outputs", "deploymentMode"], |
7235 | 7411 | "additionalProperties": false, |
7236 | 7412 | "title": "Table workflow group", |
7237 | 7413 | "description": "A workflow or enrichment producer and the columns it populates." |
|
0 commit comments