← All N8N workflows
AI & researchAggregateCodeExecute WorkflowExecute Workflow TriggerExecution Data

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.

Workflow preview
Web / APISubmit batchHTTP RequestWeb / APICheck batch statusHTTP RequestTriggerWhen Executed byAnother WorkflowExecute Workflow TriggerWeb / APIGet resultsHTTP RequestCodeParse responseCodeRoutingIf ended processingIfWaitBatch Status PollIntervalWaitTriggerRun exampleManual TriggerTransformOne query exampleEdit FieldsTransformDelete originalpropertiesEdit FieldsTransformConstruct 'requests'arrayAggregateTransformSet desired'anthropic-version'Edit FieldsSubworkflowExecute Workflow'Process Multiple…Execute WorkflowCodeBuild batch 'request'object for single queryCodeData storeSimple Memory StoreMemory Buffer WindowData storeFill Chat Memory withexample dataMemory ManagerCodeBuild batch 'request'object from Chat Memory…CodeData storeLoad Chat Memory DataMemory ManagerIntegrationFirst Prompt ResultExecution DataIntegrationSecond Prompt ResultExecution DataTransformSplit Out ParsedResultsSplit OutRoutingFilter Second PromptResultsFilterRoutingFilter First PromptResultsFilterTransformJoin two examplerequests into arrayMergeTransformAppend execution datafor single query…Edit FieldsTransformAppend execution datafor chat memory exampleEdit FieldsData storeTruncate Chat MemoryMemory Manager

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.

Workflow node names, types, and operations
NodeCategoryTypeOperation
Submit batchWeb / APIHTTP RequestPOST
Check batch statusWeb / APIHTTP RequestSee node parameters
When Executed by Another WorkflowTriggerExecute Workflow TriggerSee node parameters
Get resultsWeb / APIHTTP RequestSee node parameters
Parse responseCodeCodeSee node parameters
If ended processingRoutingIfSee node parameters
Batch Status Poll IntervalWaitWaitSee node parameters
Run exampleTriggerManual TriggerSee node parameters
One query exampleTransformEdit FieldsSee node parameters
Delete original propertiesTransformEdit FieldsSee node parameters
Construct 'requests' arrayTransformAggregateSee node parameters
Set desired 'anthropic-version'TransformEdit FieldsSee node parameters
Execute Workflow 'Process Multiple Prompts in Parallel with Anthropic Claude Batch API'SubworkflowExecute WorkflowSee node parameters
Build batch 'request' object for single queryCodeCodeSee node parameters
Simple Memory StoreData storeMemory Buffer WindowSee node parameters
Fill Chat Memory with example dataData storeMemory ManagerSee node parameters
Build batch 'request' object from Chat Memory and execution dataCodeCodeSee node parameters
Load Chat Memory DataData storeMemory ManagerSee node parameters
First Prompt ResultIntegrationExecution DataSee node parameters
Second Prompt ResultIntegrationExecution DataSee node parameters
Split Out Parsed ResultsTransformSplit OutSee node parameters
Filter Second Prompt ResultsRoutingFilterSee node parameters
Filter First Prompt ResultsRoutingFilterSee node parameters
Join two example requests into arrayTransformMergeSee node parameters
Append execution data for single query exampleTransformEdit FieldsSee node parameters
Append execution data for chat memory exampleTransformEdit FieldsSee node parameters
Truncate Chat MemoryData storeMemory ManagerSee node parameters

Setup

  1. Download the JSON and import it into an isolated n8n instance. Leave the workflow inactive.
  2. Connect your own credentials through n8n’s credential store. Replace REPLACE_WITH_* values with your resource identifiers.
  3. Inspect API destinations, Code nodes, database queries, file paths, and outbound actions.
  4. 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

User guide

Environment setup

Environment setup

For Chat History Node

anthropic-version

anthropic-version

Documentation

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)

More in AI & research