Submit batch request to Anthropic
Configured with Aggregate, Execute Workflow, Execute Workflow Trigger, Execution Data, and additional nodes. Review the connections and setup before adapting this template.
Node categories in this workflow
- Web / API
- Trigger
- Code
- Routing
- Wait
- Transform
- Subworkflow
- Data store
- Integration
Icons describe general node roles, inferred from node types. Inspect the parameters for the configured action.
Drag to pan; use + and − to zoom. Reconstructed from the exported node positions; nothing runs here. Dashed lines represent non-main connections. Full node names and notes appear below.
How it works
The exported workflow contains the following configured nodes. Their connections are shown above; inspect the JSON for the complete logic, expressions, and external actions.
| Node | Category | Type | Operation |
|---|---|---|---|
| Submit batch | Web / API | HTTP Request | POST |
| Check batch status | Web / API | HTTP Request | See node parameters |
| When Executed by Another Workflow | Trigger | Execute Workflow Trigger | See node parameters |
| Get results | Web / API | HTTP Request | See node parameters |
| Parse response | Code | Code | See node parameters |
| If ended processing | Routing | If | See node parameters |
| Batch Status Poll Interval | Wait | Wait | See node parameters |
| Run example | Trigger | Manual Trigger | See node parameters |
| One query example | Transform | Edit Fields | See node parameters |
| Delete original properties | Transform | Edit Fields | See node parameters |
| Construct 'requests' array | Transform | Aggregate | See node parameters |
| Set desired 'anthropic-version' | Transform | Edit Fields | See node parameters |
| Execute Workflow 'Process Multiple Prompts in Parallel with Anthropic Claude Batch API' | Subworkflow | Execute Workflow | See node parameters |
| Build batch 'request' object for single query | Code | Code | See node parameters |
| Simple Memory Store | Data store | Memory Buffer Window | See node parameters |
| Fill Chat Memory with example data | Data store | Memory Manager | See node parameters |
| Build batch 'request' object from Chat Memory and execution data | Code | Code | See node parameters |
| Load Chat Memory Data | Data store | Memory Manager | See node parameters |
| First Prompt Result | Integration | Execution Data | See node parameters |
| Second Prompt Result | Integration | Execution Data | See node parameters |
| Split Out Parsed Results | Transform | Split Out | See node parameters |
| Filter Second Prompt Results | Routing | Filter | See node parameters |
| Filter First Prompt Results | Routing | Filter | See node parameters |
| Join two example requests into array | Transform | Merge | See node parameters |
| Append execution data for single query example | Transform | Edit Fields | See node parameters |
| Append execution data for chat memory example | Transform | Edit Fields | See node parameters |
| Truncate Chat Memory | Data store | Memory Manager | See node parameters |
Setup
- Download the JSON and import it into an isolated n8n instance. Leave the workflow inactive.
- Connect your own credentials through n8n’s credential store. Replace
REPLACE_WITH_*values with your resource identifiers. - Inspect API destinations, Code nodes, database queries, file paths, and outbound actions.
- Run with synthetic data and harmless destinations. Enable triggers only after checking the actual outputs.
Requirements
An n8n instance with the listed node types and compatible versions. Service-connected workflows may require accounts, credentials, or paid APIs.
Credential types declared in the source
anthropicApi
Workflow notes
Parse response
JSONL separated by newlines
This workflow automates sending batched prompts to Claude using the Anthropic API. It submits multiple prompts at once and retrieves the results.
This workflow automates sending batched prompts to Claude using the Anthropic API. It submits multiple prompts at once and retrieves the results.
How to use
Call this workflow with array of requests
{
"anthropic-version": "2023-06-01",
"requests": [
{
"custom_id": "first-prompt-in-my-batch",
"params": {
"max_tokens": 100,
"messages": [
{
"content": "Hey Claude, tell me a short fun fact about video games!",
"role": "user"
}
],
"model": "claude-3-5-haiku-20241022"
}
}
]
}
Results
Results
This workflow returns an array of results with custom_ids.
[
{
"custom_id": "first-prompt-in-my-batch",
"result": {
"message": {
"content": [
{
"text": "Did you know that the classic video game Tetris was...",
"type": "text"
}
],
"id": "msg_01AiLiVZT18XnoBD4r2w9x2t",
"model": "claude-3-5-haiku-20241022",
"role": "assistant",
"stop_reason": "end_turn",
"stop_sequence": null,
"type": "message",
"usage": {
"cache_creation_input_tokens": 0,
"cache_read_input_tokens": 0,
"input_tokens": 45,
"output_tokens": 83
}
},
"type": "succeeded"
}
}
]
Set desired 'anthropic-version'
2023-06-01
Execute Workflow 'Process Multiple Prompts in Parallel with Anthropic Claude Batch API'
See above
Retrieve Message Batch Results
Retrieve Message Batch Results
Environment setup
Environment setup
For Chat History Node
anthropic-version
anthropic-version
When making API requests, you must send an anthropic-version request header. For example, anthropic-version: 2023-06-01 (latest supported version)
Append execution data for single query example
custom_id, model and max tokens
Truncate Chat Memory
ensure clean state
Submit batch request to Anthropic
Submit batch request to Anthropic
Purpose and structure
This folder contains the Submit batch request to Anthropic workflow. Its executable nodes use aggregate, code, executeWorkflow, executeWorkflowTrigger, executionData, filter, httpRequest, if, manualTrigger, memoryBufferWindow, memoryManager, merge, set, splitOut, wait. The table and connection map below are derived from the JSON, not an inferred guarantee of behavior.
Setup
Import inactive. Configure your own credentials and replace REPLACE_WITH_* values. Review external destinations and Code nodes before running.
Entry points
When Executed by Another Workflow, Run example
Verification
Sanitized source candidate; not runtime-tested. This overview is generated from node metadata. Read the folder README for the connection map, credential types, and license.
Attribution
https://github.com/Zie619/n8n-workflows/blob/94007c1445d9258a7da116646b79473e7c7c3282/workflows/Wait/0826_Wait_Splitout_Automation_Webhook.json MIT; preserve source notices.
Canvas section labels
These name areas of the original canvas; they do not include explanatory instructions.
- Usage example
- Submit batch request to Anthropic
- Loop until processing status is 'ended'
- Example usage with Chat History Node
- Example usage with single query string
- Example usage with Chat History Node (result)
- Example usage with single query string (result)