OpenAI · Arazzo Workflow

OpenAI Batch Job

Version 1.0.0

Upload a batch input file, create a batch, poll until complete, and read the output file id.

1 workflow 2 source APIs 1 provider
View Spec View on GitHub Artificial IntelligenceLarge Language ModelsT1ArazzoWorkflows

Provider

openai

Workflows

batch-job
Upload batch input, run a batch, poll to completion, and return output file id.
Uploads the batch input file, creates the batch, polls its status, and on completion returns the output and error file identifiers.
4 steps inputs: apiKey, batchInputFile, endpoint outputs: batchId, outputFileId
1
uploadInput
Upload the JSONL batch input file with the batch purpose.
2
createBatch
Create a batch using the uploaded input file and target endpoint.
3
pollBatch
Poll the batch until it reaches a terminal status, branching to the result step when completed and looping while it is still processing.
4
getResult
Retrieve the completed batch and return its output and error file ids.

Source API Descriptions

Arazzo Workflow Specification

Raw ↑
arazzo: 1.0.1
info:
  title: OpenAI Batch Job
  summary: Upload a batch input file, create a batch, poll until complete, and read the output file id.
  description: >-
    Uploads a JSONL batch input file with the batch purpose, creates a batch
    against a target endpoint, polls the batch until it reaches a terminal
    status, and on completion returns the output file id holding the results.
    Every step spells out its request inline so the flow can be read and executed
    without opening the underlying OpenAPI description.
  version: 1.0.0
sourceDescriptions:
- name: batchApi
  url: ../openapi/openai-batch-api-openapi.yml
  type: openapi
- name: filesApi
  url: ../openapi/openai-files-api-openapi.yml
  type: openapi
workflows:
- workflowId: batch-job
  summary: Upload batch input, run a batch, poll to completion, and return output file id.
  description: >-
    Uploads the batch input file, creates the batch, polls its status, and on
    completion returns the output and error file identifiers.
  inputs:
    type: object
    required:
    - apiKey
    - batchInputFile
    - endpoint
    properties:
      apiKey:
        type: string
        description: OpenAI API key used as a Bearer token.
      batchInputFile:
        type: string
        description: The JSONL batch input file contents to upload (binary/multipart field).
      endpoint:
        type: string
        description: The endpoint the batch runs against (e.g. /v1/chat/completions).
  steps:
  - stepId: uploadInput
    description: Upload the JSONL batch input file with the batch purpose.
    operationId: createFile
    parameters:
    - name: Authorization
      in: header
      value: "Bearer $inputs.apiKey"
    requestBody:
      contentType: multipart/form-data
      payload:
        file: $inputs.batchInputFile
        purpose: batch
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      inputFileId: $response.body#/id
  - stepId: createBatch
    description: Create a batch using the uploaded input file and target endpoint.
    operationId: createBatch
    parameters:
    - name: Authorization
      in: header
      value: "Bearer $inputs.apiKey"
    requestBody:
      contentType: application/json
      payload:
        input_file_id: $steps.uploadInput.outputs.inputFileId
        endpoint: $inputs.endpoint
        completion_window: 24h
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      batchId: $response.body#/id
      status: $response.body#/status
  - stepId: pollBatch
    description: >-
      Poll the batch until it reaches a terminal status, branching to the result
      step when completed and looping while it is still processing.
    operationId: retrieveBatch
    parameters:
    - name: Authorization
      in: header
      value: "Bearer $inputs.apiKey"
    - name: batch_id
      in: path
      value: $steps.createBatch.outputs.batchId
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      status: $response.body#/status
    onSuccess:
    - name: batchCompleted
      type: goto
      stepId: getResult
      criteria:
      - context: $response.body
        condition: $.status == "completed"
        type: jsonpath
    - name: batchProcessing
      type: goto
      stepId: pollBatch
      criteria:
      - context: $response.body
        condition: $.status == "validating" || $.status == "in_progress" || $.status == "finalizing"
        type: jsonpath
  - stepId: getResult
    description: Retrieve the completed batch and return its output and error file ids.
    operationId: retrieveBatch
    parameters:
    - name: Authorization
      in: header
      value: "Bearer $inputs.apiKey"
    - name: batch_id
      in: path
      value: $steps.createBatch.outputs.batchId
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      outputFileId: $response.body#/output_file_id
      errorFileId: $response.body#/error_file_id
  outputs:
    batchId: $steps.createBatch.outputs.batchId
    outputFileId: $steps.getResult.outputs.outputFileId

Work with this as data

Every workflow here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for arazzo workflows

4 MCP tools reach this
  • find_arazzoBrowse and filter every workflow in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This workflow
curl "https://apis.io/api/v1/arazzo/openai-batch-job-workflow"
All arazzo workflows
curl "https://apis.io/api/v1/arazzo?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.