Claude
Use Claude models in workflows
Actions
Section titled “Actions”Instructions
Section titled “Instructions”To get new Claude API key, go to platform.claude.com.
Files & artifacts
Section titled “Files & artifacts”The Files API is in beta: SuperPlane enables it per request via the anthropic-beta header, so no console toggle is needed and a standard API key suffices. Files and sessions are scoped to the API key’s workspace. For Run Managed Agent artifacts, the agent must save its deliverables under /mnt/session/outputs/.
Create Batch Message
Section titled “Create Batch Message”Component key: claude.createBatchMessage
The Create Batch Message component uses Anthropic’s Message Batches API to run one or more prompts over an array of inputs in a single batch, at a lower cost than issuing them individually.
Every batch is built from a matrix: an array of Items (the N data points, e.g. a list of pull requests) crossed with one or more prompts. Mode controls whether that’s a single prompt (1 x N) or several (M x N).
Use Cases
Section titled “Use Cases”- Update the same kind of resource, one at a time or many at once: pass a one-element array to update a single pull request, or the full list to update every open one, with the same node.
- Multiple derived outputs per item: generate a title suggestion, a description suggestion, and a risk assessment for every pull request in one batch (Multiple Prompts mode).
- Bulk classification or extraction: run the same prompt over many inputs at once, at a lower cost than individual requests.
How It Works
Section titled “How It Works”- Evaluates Items to an array, then builds one request per item (Single Prompt) or one request per (prompt, item) pair (Multiple Prompts).
- Submits them as a single batch and polls it until it ends.
- Emits Results: one entry per element of Items, in the same order.
Batches typically complete within an hour, but can take up to 24 hours. This component polls with increasing backoff and keeps the execution open (without emitting) until the batch ends.
Configuration
Section titled “Configuration”- Items: An expression evaluating to the array to run over, e.g.
$['List Open Pull Requests'].body. Use a one-element array to run over a single item. - Model: The Claude model used for every request.
- System Message: (Optional) Context applied to every request.
- Mode: Whether one prompt or several are applied to each item.
- Single Prompt: one prompt, applied to every element of Items.
- Multiple Prompts: several prompts, each applied to every element of Items.
- Prompt (Single Prompt mode): The prompt sent for every item. Plain text is sent verbatim; use
{{ item }}and{{ index }}to reference the current item and its position, e.g.Suggest a title for PR #{{ item.number }}: {{ item.body }}. - Prompts (Multiple Prompts mode): A short list of prompts (each with an ID and its own text, using
{{ item }}/{{ index }}the same way). Each one is sent for every element of Items. - Structured Output: (Optional) A JSON Schema every response must conform to.
Output
Section titled “Output”Emits a single payload once the batch ends, containing:
- status:
ended,timeout, orerror. - batchId: The Anthropic batch ID.
- requestCounts: How many requests succeeded, errored, were canceled, or expired.
- results: One entry per element of Items, in order (
results[i]corresponds to the i-th item). In Single Prompt mode each entry has its owntext/parsed/etc. directly; in Multiple Prompts mode each entry has apromptsobject keyed by prompt ID, e.g.results[i].prompts.title.text.
- Requires a valid Claude API key configured in the integration.
- A batch can contain up to 1000 requests (prompts x items, in Multiple Prompts mode).
- Cancelling the workflow execution requests cancellation of the batch on Anthropic’s side; requests already completed are unaffected.
Example Output
Section titled “Example Output”{ "data": { "batchId": "msgbatch_01HkcTjaV5uDC8jWR4ZsqFqz", "requestCounts": { "canceled": 0, "errored": 0, "expired": 0, "processing": 0, "succeeded": 2 }, "results": [ { "index": 0, "stopReason": "end_turn", "text": "Paris is the capital of France.", "type": "succeeded", "usage": { "input_tokens": 12, "output_tokens": 9 } }, { "index": 1, "stopReason": "end_turn", "text": "Berlin is the capital of Germany.", "type": "succeeded", "usage": { "input_tokens": 12, "output_tokens": 9 } } ], "status": "ended" }, "timestamp": "2026-07-07T12:00:00Z", "type": "claude.createBatchMessage.result"}Get Daily Usage
Section titled “Get Daily Usage”Component key: claude.getDailyUsage
The Get Daily Usage component fetches usage metrics from Anthropic’s Admin API, combining raw API/SDK token usage with Claude Code productivity metrics.
Use Cases
Section titled “Use Cases”- Usage reporting: Track token consumption and Claude Code productivity across the org
- Cost tracking: Monitor estimated Claude Code spend by model
- Analytics dashboards: Build custom dashboards combining both data sources
How It Works
Section titled “How It Works”- Fetches token usage for the date range from the Messages usage report
- Fetches productivity metrics (sessions, lines of code, commits, PRs, tool actions) for the date range from the Claude Code usage report
- Aggregates both into rollup totals, per-model/per-actor breakdowns, and a daily time series
Configuration
Section titled “Configuration”- Start Date: Start of the date range (YYYY-MM-DD format, defaults to 7 days ago)
- End Date: End of the date range (YYYY-MM-DD format, defaults to today)
Output
Section titled “Output”- messages: Token usage totals and per-model breakdown (no cost data; Messages usage has no dollar figure attached)
- claudeCode: Sessions, lines of code, commits, pull requests, tool action accept/reject counts, estimated cost, and per-model/per-actor breakdowns
- daily: Org-wide per-day rollup combining both reports, for trend charts
- Requires an Admin API key configured in the integration, separate from the regular API key
- The date range cannot exceed 31 days
- The Claude Code usage report only accepts one day per call, so the component issues one request per day in the range
Example Output
Section titled “Example Output”{ "data": { "period": { "startDate": "2026-06-26", "endDate": "2026-07-03" }, "messages": { "inputTokens": 1250000, "outputTokens": 380000, "cacheReadTokens": 900000, "cacheCreationTokens": 60000, "webSearchRequests": 42, "byModel": [ { "model": "claude-sonnet-5", "inputTokens": 1250000, "outputTokens": 380000, "cacheReadTokens": 900000, "cacheCreationTokens": 60000 } ] }, "claudeCode": { "sessions": 87, "linesAdded": 15400, "linesRemoved": 6200, "commits": 63, "pullRequests": 21, "toolActionsAccepted": 512, "toolActionsRejected": 34, "estimatedCostUsd": 42.17, "byModel": [ { "model": "claude-sonnet-5", "inputTokens": 45230, "outputTokens": 12450, "estimatedCostUsd": 1.86 } ], "byActor": [ { "actor": "developer@company.com", "type": "user_actor", "sessions": 12, "linesAdded": 2200, "linesRemoved": 900, "commits": 9, "pullRequests": 3 } ] }, "daily": [ { "date": "2026-06-26", "messagesInputTokens": 178571, "messagesOutputTokens": 54285, "codeSessions": 12, "codeLinesAdded": 2200, "codeLinesRemoved": 900, "codeCommits": 9, "codePullRequests": 3, "codeEstimatedCostUsd": 6.02 } ] }, "timestamp": "2026-07-03T19:29:35.841265352Z", "type": "claude.getDailyUsage.result"}Run Managed Agent
Section titled “Run Managed Agent”Component key: claude.runAgent
The Run Managed Agent component uses Claude Managed Agents to start a session with a configured agent and environment, sends your task as a user message, and waits until the session reaches a terminal state (idle or terminated) by polling. Log streaming is not used.
Prerequisites
Section titled “Prerequisites”- A Claude API key on the integration.
- An agent and environment already created in the Anthropic API (or Console). This step lists them for selection.
Configuration
Section titled “Configuration”- Agent and optional Version: the Managed Agent to run. Pick an agent, then optionally pin a Version (the latest is used when left unset).
- Environment: The environment the session runs in.
- Prompt: The user message (task) sent to the agent.
- Vault IDs (optional): For MCP tools that need vault-backed credentials.
- Keep Session After Run (optional): By default the session is deleted once the run finishes. Enable this to keep it so you can read the full transcript in the Anthropic Console when debugging. It applies only to runs that finish — a cancelled run is always cleaned up. Kept sessions are never reclaimed automatically, so delete them yourself when you’re done.
- Structured Output (optional): A JSON Schema the agent is asked to match in its final message. Managed Agents sessions have no server-enforced equivalent to the Messages API’s
output_config.formatused by Text Prompt, so this works by appending instructions to the task asking the agent to include a JSON code block matching the schema, then best-effort parsing it from the final message. Treat the result as best-effort, not a guarantee — validate before relying on it downstream.
Output
Section titled “Output”Emits a finished payload with session status, session id, and the final agent message when available so downstream steps can branch or consume the result. For failure cases the status is still emitted when the session is terminated or the step times out.
When Structured Output is configured, parsed carries the JSON object extracted from the final message — only when the session finished normally (idle), never on a timeout, error, or terminated session.
Files the agent saves under /mnt/session/outputs/ are emitted as artifacts with their content included in the payload (text files as plain text, everything else base64-encoded; files over 10MB carry metadata and a download link only). Instruct the agent in the task to save its deliverables there.
Example Output
Section titled “Example Output”{ "data": { "artifacts": [ { "content": "# Report\n\nAll checks passed.\n", "downloadUrl": "https://api.anthropic.com/v1/files/file_011CNha8iCJcU1wXNR6q4V8w/content", "encoding": "text", "fileId": "file_011CNha8iCJcU1wXNR6q4V8w", "filename": "report.md", "mimeType": "text/markdown", "sizeBytes": 4096 } ], "lastMessage": "Finished the requested task.", "messages": [ "Let me check the documentation...", "Finished the requested task." ], "sessionId": "sess_01ExampleManagedSession", "status": "idle" }, "timestamp": "2026-04-26T12:00:00Z", "type": "claude.runAgent.finished"}Run Code Agent
Section titled “Run Code Agent”Component key: claude.runCodeAgent
The Run Code Agent component runs an autonomous Claude coding agent using Claude Managed Agents. You pick a repository (or an existing pull request) and describe a task; the component provisions a network-enabled sandbox with a scoped GitHub token, and the agent clones the repo, does the work, commits, pushes, and opens or updates a pull request — entirely on its own.
Prerequisites
Section titled “Prerequisites”- A Claude API key on the integration.
- A GitHub token (stored as a SuperPlane secret) with permission to read the repo and open pull requests.
- Repository — start new work: the agent branches from the base branch, implements the task, and opens a PR.
- Pull request — update an existing PR: the agent checks out the PR’s branch, applies the task, and pushes to it. Only same-repository pull requests are supported; PRs opened from forks are rejected.
Debugging
Section titled “Debugging”By default the session and its sandbox are torn down as soon as the run finishes. Enable Keep Session After Run to keep them, so you can read the agent’s full transcript in the Anthropic Console. The vault holding your GitHub token is always reclaimed, whether or not you keep the session.
The setting applies only to runs that finish — including ones that fail or time out, which are usually the ones worth reading. A run that is cancelled, or that errors before the agent starts, is always torn down: there is no transcript to read, and nothing would ever reclaim the sandbox afterwards.
Kept sessions and environments are not reclaimed automatically, so delete them yourself once you’re done debugging.
Structured Output
Section titled “Structured Output”Optional: a JSON Schema the agent is asked to match in its final message, in addition to the PR it opens. Managed Agents sessions have no server-enforced equivalent to the Messages API’s output_config.format used by Text Prompt, so this works by appending instructions to the task asking the agent to include a JSON code block matching the schema, then best-effort parsing it from the final message. Treat the result as best-effort, not a guarantee — validate before relying on it downstream.
Output
Section titled “Output”Emits the final status, the pull request URL, the working branch, and a summary so downstream steps can branch or post the result.
When Structured Output is configured, parsed carries the JSON object extracted from the final message — only when the session finished normally (idle), never on a timeout, error, or terminated session.
Files the agent saves under /mnt/session/outputs/ are additionally emitted as artifacts with their content included in the payload (text files as plain text, everything else base64-encoded; files over 10MB carry metadata and a download link only).
Example Output
Section titled “Example Output”{ "data": { "artifacts": [ { "content": "# Migration notes\n\nRenamed the legacy column.\n", "downloadUrl": "https://api.anthropic.com/v1/files/file_011CNha8iCJcU1wXNR6q4V8w/content", "encoding": "text", "fileId": "file_011CNha8iCJcU1wXNR6q4V8w", "filename": "migration-notes.md", "mimeType": "text/markdown", "sizeBytes": 2048 } ], "branch": "claude/agent-1a2b3c4d5e6f", "lastMessage": "Done. PR_URL=https://github.com/owner/repo/pull/42", "prUrl": "https://github.com/owner/repo/pull/42", "sessionId": "sess_01ExampleCodeSession", "status": "idle" }, "timestamp": "2026-07-02T12:00:00Z", "type": "claude.runCodeAgent"}Text Prompt
Section titled “Text Prompt”Component key: claude.textPrompt
The Text Prompt component uses Anthropic’s Claude models to generate text responses.
Use Cases
Section titled “Use Cases”- Summarization: Generate summaries of incidents or deployments.
- Code Analysis: specific code review or PR comments.
- Content Generation: Create documentation or drafting communications.
Configuration
Section titled “Configuration”- Model: The Claude model to use.
- System Message: (Optional) Context to define the assistant’s behavior or persona.
- Prompt: The main user message or instruction.
- Files: (Optional) Files from the Files tab (images, PDFs, or text) to attach alongside the prompt.
- Code Execution: (Optional) Allow Claude to write and run code in Anthropic’s sandbox. Files it creates are emitted as artifacts.
- Structured Output: (Optional) A JSON Schema the response must match, available on the parsed output.
Output
Section titled “Output”Returns a payload containing:
- text: The content generated by Claude.
- usage: Input and output token counts.
- stopReason: Why the generation ended (e.g., “end_turn”, “max_tokens”).
- model: The specific model version used.
- parsed: When Structured Output is configured, the response parsed into an object (only on a normal end_turn completion).
- artifacts: When Code Execution is enabled, the files Claude generated, with the file content included: text files as plain text (
encoding: "text"), everything else base64-encoded (encoding: "base64"). Each artifact carries fileId, filename, mimeType, sizeBytes, and a downloadUrl; files over 10MB include metadata and the download link only.
- Requires a valid Claude API key configured in integration
- Response quality and speed depend on the selected model
- Token usage is tracked and may incur costs based on your Claude plan
Example Output
Section titled “Example Output”{ "data": { "artifacts": [ { "content": "service,status\napi,deployed\n", "downloadUrl": "https://api.anthropic.com/v1/files/file_011CNha8iCJcU1wXNR6q4V8w/content", "encoding": "text", "fileId": "file_011CNha8iCJcU1wXNR6q4V8w", "filename": "deployment-summary.csv", "mimeType": "text/csv", "sizeBytes": 2048 } ], "id": "msg_01X9JGt5...123456", "model": "claude-3-5-sonnet-latest", "parsed": { "severity": "low", "summary": "Deployment completed successfully" }, "response": { "content": [ { "text": "Here is the summary of the deployment logs you requested...", "type": "text" } ], "id": "msg_01X9JGt5...123456", "model": "claude-3-5-sonnet-latest", "role": "assistant", "stop_reason": "end_turn", "type": "message", "usage": { "input_tokens": 45, "output_tokens": 120 } }, "stopReason": "end_turn", "text": "Here is the summary of the deployment logs you requested...", "usage": { "input_tokens": 45, "output_tokens": 120 } }, "timestamp": "2026-02-06T12:00:00Z", "type": "claude.message"}