Skip to content

Fix a Workflow With the AI Assistant

~20 minutes · a failing step, an AI diagnosis, an applied fix

You run a workflow, a step turns red, and the error text alone doesn’t tell you what to change. This tutorial walks that exact moment: you open PlaidCloud’s built-in AI Assistant, let it diagnose the failing step against your live data, approve the fix it proposes, and re-run to confirm. Then you use the same assistant to write a SQL Extract step from a plain-language description.

This is the in-product AI Assistant that helps you build and fix workflows. It is not the same thing as connecting an external AI coding agent (Claude Code, Cursor, MCP) to your tenant — that complementary path lives in Connect an AI Coding Agent.

Stage You’ll use
See the step fail and read the error The project Log tab
Diagnose and fix the failing step The AI Analysis fix assistant
Confirm the fix Re-run the step
Add a new query without writing SQL Generate SQL with AI in an Extract SQL step
  • A PlaidCloud workspace (start a free trial if you don’t have one) and a project you can edit.
  • A workflow with at least one step — ideally one that fails, or that you can make fail (a mistyped column name in a transform is enough to reproduce the scenario).

The assistant fixes with your permissions. It can only change a step you could already edit yourself, and every change it makes is reversible by re-running it or editing the step directly. See Fixing Workflow Errors with AI.

Step 1: Run the Workflow and Find the Error

Section titled “Step 1: Run the Workflow and Find the Error”

When a step fails, an error indicator appears on both the workflow and the step that failed, and the failure is written to the workflow log.

  1. Open your project and run the workflow (or the single step you’re testing).
  2. Switch to the project’s Log tab. The log lists events as steps run — including warnings and errors.
  3. In the log list, select the entry for the step that failed. Its full message — including any traceback — opens in the panel on the right under the Log Message tab.

No broken workflow handy? Make one in 30 seconds. In any transform step, edit one column’s expression to reference a column that doesn’t exist — change net_amount to net_amnt, say — and save. Run the step and it fails with a KeyError/column not found error in the log, naming the bad column. That’s a genuine misconfiguration the fix assistant is built to catch, so it’s a clean way to follow this tutorial end to end.

For more on how errors surface and the options for handling them, see Managing Step Errors and Viewing Workflow Log.

The fix assistant lives right beside the raw error, already pointed at the step that failed.

  1. With the failing log entry selected, find the panel on the right showing Log Message.
  2. Switch that panel to the AI Analysis tab.

The AI Analysis chat opens already pointed at the workflow and step the selected log entry came from, so it starts diagnosing straight away — you don’t have to tell it which step failed. You can read the raw error under Log Message and chat with the assistant under AI Analysis side by side.

The assistant works in a fixed order, and nothing is saved until you say so:

  1. Diagnoses — it reads the failing step’s configuration and the tables and columns it touches, checking its claims against your data rather than guessing from the error text alone.
  2. Proposes — if it finds a genuine misconfiguration, it shows the corrected step configuration and explains plainly what it changed and why. Nothing is written at this point.
  3. You approve — it waits for your explicit go-ahead. An ambiguous reply isn’t taken as approval.
  4. Applies — once you approve, it writes the corrected configuration to the step, through the same path the step editor uses.
  5. Re-run — it tells you to re-run the step to confirm the fix.

Read the proposed change before you approve it. The assistant repairs the configuration of the one step the error came from — for example a mistyped column or function name, an invalid expression, a wrong data type or cast, or malformed SQL — and it changes the least that fixes the error.

It’s honest about what it can’t fix. Its only lever is that one step’s configuration. It won’t create, delete, or reorder steps, edit a different step, or change your data. Many failures aren’t configuration problems at all — missing or malformed source data, an upstream step that failed first, a transient or infrastructure error, a permissions issue, or broken logic inside a transform or UDF. For those it explains what it found and points you to where the real fix lives, rather than bending an edit to look like a solution.

  1. When the proposed configuration looks right, confirm the change explicitly. The assistant applies it to the step.
  2. Re-run the step (or the workflow) to confirm the error is resolved.

If the assistant told you the cause is outside the step’s configuration — bad data, an upstream failure, a permissions problem — that is the answer. Fix it where it actually lives rather than asking the assistant to edit the step anyway.

Warnings are often benign. If the log entry is a warning rather than a hard failure, the assistant will often tell you no change is needed rather than invent an edit. That’s a valid outcome, not a dead end.

Step 5: Generate a SQL Extract Step With AI

Section titled “Step 5: Generate a SQL Extract Step With AI”

Now use the same underlying assistant to add new work, not just repair it. The Extract SQL step runs a read-only SELECT and writes the result into a new table — and the step editor can write that query for you.

  1. From the workflow’s Steps view, click Create Step and choose either Tables → Extract SQL or AI → SQL Extract (AI Assisted). Both open the same editor, which includes a Generate SQL with AI panel at the top of the SQL Extract Parameters page.
  2. (Optional) Choose source tables. In the Source Tables list, select one or more tables the query should read from. Leave it empty to let the Assistant examine the project and choose the relevant tables itself.
  3. Describe what you want. In the Describe box, write the outcome in plain language — for example, “classify each ledger account into an activity pool based on its account number range”.
  4. Click Generate SQL. The Assistant writes a single read-only SELECT, validates it by running it, and fills in the SQL Select Query editor and the Table Data Selection mapping page with the detected columns. If you left the source list empty, the tables it chose are selected back in the list so you can see what it used.

There’s nothing to set up. This uses the same built-in model the AI Assistant uses — you don’t need to configure a per-workspace AI agent or LLM connection for it.

The generated SQL is a starting point, not a black box.

  1. Edit it freely. The SQL editor is fully editable — refine the query, add a join, or change the column list before saving.
  2. Pick a target table. Choose or name the Target Table the step writes its result into.
  3. Save the step. It’s saved as an ordinary Extract SQL step and runs as part of the workflow like any other.

The Assistant only writes read-only SELECT statements — never INSERT, UPDATE, DELETE, or other data-changing SQL. Generation drafts and previews only; the step is created when you save it and runs when the workflow runs. If a generated query doesn’t run, the editor shows the SQL along with the error so you can correct it — or adjust your description and generate again. Full detail in Generating SQL Extract Steps with AI.

That’s the assist. You’ve diagnosed a failing step against live data, approved and applied the AI’s fix, confirmed it with a re-run, and generated a working SQL Extract step from a plain-language sentence — the same assistant repairing what’s broken and building what’s new.