Diagnose a failed AI workflow without exposing credentials

Find the first bad input or tool call, protect the diagnostic evidence, and check earlier external effects before replaying a failed workflow.

A magnifying glass over a paper log beside a graphite printer and blue card sleeve.

Open the failed execution in n8n and find the first point where the data or action diverged from what you expected. Before retrying or sharing the log, check whether an earlier node already sent a message or changed a record. Then reduce the problem to a harmless input that reproduces the failure.

I would diagnose the input, credentials, and provider response before replacing the model. A workflow can also finish successfully while its agent chooses the wrong tool or produces an unsupported answer. Those cases need a trace of the agent’s actions, not another blind retry.

Find the run and preserve the useful evidence

In the workflow, open Executions and filter by status and start time. Choose the run that matches the reported incident. Note the n8n version, node type and version, operation, failure time, error type, and HTTP status where present. Keep the original evidence in its access-controlled location rather than pasting the entire execution into a chat or support ticket.

Look at the failing node’s input and the preceding node’s output. An error at an API call may start with an empty field or an unexpected array several steps earlier. Check the particular item that failed, not just the first example shown in the editor.

Also inspect any completed sends or writes. A failure after an email node does not undo that email. A timeout does not prove the destination rejected the request. Check the destination’s record or request identifier before deciding whether another attempt is safe.

Match the symptom to the next check

SymptomCheck firstUseful next action
Missing prompt or null contentThe resolved expression and incoming fieldSupply the intended text field; do not send null to the model.
Invalid JSON or bad requestBody structure, query names, required fields, and typesCompare one sanitized request with the service’s documented format.
Forbidden or authentication errorSelected credential, account, permissions, and operation scopeCorrect the credential or permission through the credential settings.
Too many requestsThe provider’s error category and request-frequency limitsPace requests or use a bounded retry that fits the provider’s guidance.
Insufficient quotaThe API key’s organization/project, credit, and usage limitsResolve the account limit; repeated requests do not add credit.
Connection refusedWhere n8n runs and where the target service listensVerify a reachable host and port from that runtime.
Green execution, wrong answerContext, tool choice, arguments, and tool outputTrace the first incorrect decision and add a check for the expected result.

The AI Agent troubleshooting page identifies null prompt content and missing prompt configuration as specific input problems. When the agent expects Connected Chat Trigger Node but your input comes from elsewhere, inspect the Prompt setting and use Define below with the intended field. A missing Chat Model connection needs a model sub-node, not a rewritten prompt.

For HTTP Request failures, verify the endpoint and request format against that API. In Docker, localhost refers to the n8n container, not your host computer. Changing a model setting cannot fix a request aimed at the wrong machine.

Inspect the agent’s model and tool entries

Expand the agent’s Logs tree and inspect the relevant model, memory, and tool entries. Compare what the agent received, which tool it called, the arguments it supplied, and what the tool returned. The n8n agent-debugging walkthrough illustrates this sequence.

n8n log tree with model, memory and tool entries nested under AI Agent
Expand the agent entry to inspect its model, memory, and tool calls.

If the answer invents a policy, check whether the correct policy ever reached the agent. If the wrong tool ran, compare the tools’ descriptions. If the right tool received the wrong record identifier, check the parameter description and resolved value. Change one cause at a time so the next run can tell you something useful.

For multi-item inputs, inspect expression behavior in sub-nodes. The OpenAI Chat Model documentation says sub-node expressions resolve to the first item. Do not assume they resolve separately for every item as ordinary nodes do.

A parser succeeding is also different from an answer being correct. The Structured Output Parser targets an agent’s final output, not intermediate tool stages. n8n recommends a separate LLM chain for parsing agent output. Continue to validate required values and facts before a downstream action.

Replay a diagnostic copy, with safe destinations

In a separate diagnostic copy, replace live inputs with invented values and disconnect or replace nodes that send, write, delete, or spend money. Preserve the original workflow and execution for comparison. Data pinning can prevent a pinned source from fetching fresh data during development; it does not make every later node harmless.

The Debug executions controls use Debug in editor for a failed run and Copy to editor for a successful one. They load prior execution data into your current workflow and pin the first node. Availability covers all n8n Cloud plans and registered Community, Business, and Enterprise self-hosted editions; saved runs depend on workflow settings.

The Executions list also offers Retry with currently saved workflow and Retry with original workflow. Choose deliberately; neither label is a promise that repeating an external effect is safe. Pinned data is for development and is not used in production executions.

For transient rate limits, open the node’s Settings and configure Retry On Fail. The current rate-limit documentation caps Max Tries at five and Wait Between Tries at 5,000 ms. HTTP Request does not automatically honor Retry-After. Longer pauses need batching or a Loop Over Items and Wait pattern suited to the provider’s limits. Do not apply retries indiscriminately to invalid input or a potentially completed write.

Share a small, sanitized reproduction

A useful support packet contains the version and node information, operation, generic error type and status, expected behavior, actual behavior, and a minimal input with invented values. Include the request shape while removing authentication headers, cookies, tokens, customer text, private file URLs, and identifiers that are not needed to reproduce the issue. Read the final packet yourself; a replacement rule cannot guarantee it found every secret.

Exported workflow JSON can include credential names and IDs. Credential names may reveal private information, and HTTP Request nodes imported from cURL can contain authentication headers. Inspect the export before sharing it. If a real secret was disclosed, revoke or rotate that secret and correct the credential; deleting it from the next screenshot does not invalidate the exposed value.

Execution data redaction is an Enterprise feature on Cloud and self-hosted n8n. Per-workflow redaction starts at 2.16.0; instance enforcement starts at 2.26.0. Manual and production redaction are separate settings. Redacted views retain status, timing, node names, error type, and HTTP status while hiding payloads and detailed error messages.

Redaction controls execution-data visibility. It does not encrypt the underlying database or stop downstream nodes, webhook responses, or outbound requests from carrying data. Code-node console.log output is outside this protection. Keep secrets out of diagnostic logging even when redaction is enabled.

Make the next failure easier to find

Use an error workflow for notification, and a node’s error output for a specific recoverable branch. The current node settings distinguish Stop Workflow, Continue, and Continue (using error output). Continue proceeds with the last valid data; it is not proof that the failed action succeeded. Inspect and handle the error branch explicitly.

A handled error can leave the overall execution looking successful. Check that the intended success and error branches receive the expected items in your installed node version. If a required business condition fails without a node error, add an explicit validation branch; n8n’s Stop And Error node can deliberately fail the execution.

To configure alerts, create a workflow beginning with Error Trigger, publish it, and select it under the main workflow’s Options → Settings → Error workflow. Error Trigger responds to automatic failures, not manual test runs. Check the handler using a harmless automatic failure in an isolated test workflow.

Keep alerts to an error category, responsible workflow, and an access-controlled execution link where available. The execution ID and URL depend on saved execution data and can be absent when the main trigger fails. Do not assume the error event contains the complete original payload. Group repeated alerts so a failing scheduled workflow does not bury the useful signal.

Finish the diagnosis with a repeatable test case: the sanitized failing input, the expected branch, and the output that would count as correct. Check the original problem and a normal input after the fix. That gives the next workflow change something concrete to preserve.