Skip to main content

Process multiple requests in FIFO using OpenAI Batch API and Supabase/Postgres

Workflow preview

Workflow preview
100%
Process multiple requests in FIFO using OpenAI Batch API and Supabase/Postgres preview
Open on n8n.io

1. Workflow Overview

How it works You provide a list of prompts and a system instruction, the workflow batches them into a single OpenAI Batch API request. The batch job is tracked in a Supabase openai batches table. A...

Best for

  • Engineering automation workflows
  • AI Summarization automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.httprequest, n8n-nodes-base.manualtrigger, n8n-nodes-base.if, n8n-nodes-base.code, n8n-nodes-base.extractfromfile, n8n-nodes-base.scheduletrigger, n8n-nodes-base.supabase, n8n-nodes-base.postgres

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Teng Wei Herr.

Original n8n.io source

1.1 Workflow description

Title
Process multiple requests in FIFO using OpenAI Batch API and Supabase/Postgres
Workflow name
Process multiple requests in FIFO using OpenAI Batch API and Supabase/Postgres

How it works

You provide a list of prompts and a system instruction, the workflow batches them into a single OpenAI Batch API request. The batch job is tracked in a Supabase openai_batches table. A cron job polls OpenAI every 5 minutes, and once the batch completes, the results are decoded and stored back in Supabase.

Set up steps

Create the openai_batches table in Supabase. Schema is in the yellow sticky note. Add your OpenAI and Supabase/Postgres credentials to the workflow. Replace the mock data with your actual prompts and you're ready to go!

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Call Files API

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 2 - Call Batch API

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 3 - Start (mock data)

Type / Role
n8n-nodes-base.manualTrigger - manualTrigger
Config choices
Version 1

Block 4 - If status = completed

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.3

Block 5 - Convert to batch requests in .jsonl

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 6 - .jsonl to base64

Type / Role
n8n-nodes-base.extractFromFile - extractFromFile
Config choices
Version 1.1

Block 7 - Decode base64

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 8 - Call Batch API to retrieve batch object

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.1

Block 9 - Download .jsonl result

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.1

Block 10 - Cron Job (5 mins)

Type / Role
n8n-nodes-base.scheduleTrigger - scheduleTrigger
Config choices
Version 1.3

Block 11 - Create a row in batch table

Type / Role
n8n-nodes-base.supabase - supabase
Config choices
Version 1

Block 12 - Get the earliest uncompleted batch

Type / Role
n8n-nodes-base.postgres - postgres
Config choices
Version 2.6

Block 13 - Update status

Type / Role
n8n-nodes-base.supabase - supabase
Config choices
Version 1

Block 14 - Update status and result

Type / Role
n8n-nodes-base.supabase - supabase
Config choices
Version 1

Block 15 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 16 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 17 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 18 - Submission done

Type / Role
n8n-nodes-base.noOp - noOp
Config choices
Version 1

Block 19 - Retrieval done

Type / Role
n8n-nodes-base.noOp - noOp
Config choices
Version 1

3. Summary Table

Workflow Process multiple requests in FIFO using OpenAI Batch API and Supabase/Postgres
Complexity advanced
Nodes 19
Categories Engineering, AI Summarization
Author Teng Wei Herr
Published 06 Feb 2026

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/13238/13238.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Process multiple requests in FIFO using OpenAI Batch API and Supabase/Postgres do?

How it works You provide a list of prompts and a system instruction, the workflow batches them into a single OpenAI Batch API request. The batch job is tracked in a Supabase openai batches table. A...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Engineering, AI Summarization use case.