Continue
AI-generatedSummary
Continues the most recent Claude Code conversation in the working directory by sending a new prompt through the Claude Agent SDK with continue: true, running once per input item and returning the result in the chosen output format.
Inputs
- prompt (required) — Follow-up instruction sent to Claude Code. Empty or whitespace-only prompts throw an error.
- model — Sonnet (default) or Opus.
- maxTurns — Maximum conversation turns (default 25). If the limit is hit, the result reports it.
- timeout — Seconds before the run is aborted (default 300).
- projectPath — Working directory for Claude Code. If empty, uses the n8n process's current directory. The continued session is the previous one for that directory, so keep it consistent with the earlier Query.
- outputFormat — Structured (default: messages, summary, result, metrics, success), Messages (raw message array and count), or Text (result, success, duration_ms, total_cost_usd).
- allowedTools — Built-in tools Claude may use. Defaults to WebFetch, TodoWrite, WebSearch, exit_plan_mode, Task.
- disallowedTools — Built-in tools explicitly blocked. Takes precedence over Allowed Tools.
- additionalOptions — Optional collection: Debug Mode, Fallback Model (Sonnet/Opus/None), Max Thinking Tokens (0 = unset), Permission Mode (default is Bypass Permissions), and System Prompt.
Output shape
One output item per input item, paired to its input. The shape depends on Output Format. Structured returns messages, summary (message counts, tool-use count, tools available), result, metrics (duration, turns, cost, usage) and success. Messages returns messages and messageCount. Text returns result, success, duration_ms and total_cost_usd.
The executable path is hardcoded to /usr/local/bin/claude, so the Claude Code CLI must be installed there on the n8n host. In Text format, SDK errors are returned as an item with success false instead of throwing. In other formats errors throw, or are returned as an item with error and errorType (timeout or execution_error) if Continue On Fail is enabled. A timeout aborts the run. The timeout message mentions 'Additional Options', but Timeout is a top-level field.
Examples
Example 1: Ask a follow-up after an initial Query node generated code in a project.
Operation: Continue; Prompt: 'Now add unit tests for the parser'; Project Path: /home/user/projects/my-app (same as the Query node); Output Format: Text.
Example 2: Run a read-only follow-up review with a stronger model.
Operation: Continue; Model: Opus; Prompt from {{$json.prompt}}; Disallowed Tools: Bash, Edit, MultiEdit, Write; Timeout: 600.