Create Pipeline from SQL
create_pipeline_from_sqlPlan and create a Coalesce pipeline from exact user SQL, automatically resolving workspace sources and generating compatible nodes.
Instructions
Plan and create a Coalesce pipeline from user-provided SQL. Pass the user's EXACT SQL unchanged. The SQL may use raw table names or already contain Coalesce {{ ref() }} syntax if that is what the user provided. Do NOT rewrite between styles or otherwise modify the query. The planner resolves workspace sources automatically and generates a Coalesce-compatible joinCondition for the final node.
If you are building a pipeline yourself, use declarative tools directly: create_workspace_node_from_predecessor → convert_join_to_aggregation → replace_workspace_node_columns.
This tool validates candidate node types against currently observed workspace nodes. If a selected type is not observed, the plan will include a warning asking the user to confirm installation in Coalesce.
Consult coalesce://context/node-type-corpus for node type patterns and metadata structures.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | The user's EXACT SQL, copied verbatim. It may use raw table names or existing Coalesce {{ ref() }} syntax. Do NOT rewrite between SQL styles or modify it in any way. Pass it exactly as the user provided it. | |
| goal | No | Optional business goal or context for the SQL | |
| dryRun | No | When true, return the generated plan without creating nodes. | |
| schema | No | Optional target schema | |
| database | No | Optional target database | |
| repoPath | No | Optional local committed Coalesce repo path for repo-first node-type ranking. Falls back to COALESCE_REPO_PATH or `repoPath` in the active ~/.coa/config profile when omitted. | |
| confirmed | No | Set to true only after presenting the ready plan to the user and receiving explicit approval. Must be paired with the confirmationToken returned by the prior STOP_AND_CONFIRM response. | |
| targetName | No | Optional target node name override | |
| description | No | Optional node description | |
| workspaceID | Yes | The workspace ID | |
| locationName | No | Optional target locationName | |
| targetNodeType | No | Optional node type override. When omitted, the planner ranks repo-backed and observed workspace node types for the use case. | |
| configOverrides | No | Optional config overrides to merge into the final node body. | |
| confirmationToken | No | The token returned in the STOP_AND_CONFIRM response. Required when confirmed=true to prove the plan was presented to the user. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| plan | No | ||
| error | No | ||
| dryRun | No | ||
| reason | No | ||
| created | No | ||
| warning | No | ||
| cancelled | No | ||
| nodeCount | No | ||
| incomplete | No | ||
| workspaceID | No | ||
| createdNodes | No | ||
| cleanupFailures | No | ||
| STOP_AND_CONFIRM | No | ||
| failedPlanNodeID | No | ||
| cleanupFailedNodeIDs | No |