Amazon S3 · Arazzo Workflow

Amazon S3 Get Object or Create It

Version 1.0.0

Check whether an object exists with HEAD and upload it only if missing.

1 workflow 1 source API 1 provider
View Spec View on GitHub ArchiveBackupCloud StorageData StorageObject StorageScalable StorageArazzoWorkflows

Provider

amazon-s3

Workflows

get-or-create-object
Upload an object only when it does not already exist.
Uses HeadObject to detect the presence of an object and only writes it with PutObject when the object is not found.
2 steps inputs: bucket, objectBody, objectKey outputs: createdEtag, existingEtag
1
headObject
Probe for the object with a HEAD request. A 200 means it exists; a 404 means it must be created.
2
putObject
Upload the object's binary body because the HEAD request reported it was not present.

Source API Descriptions

Arazzo Workflow Specification

Raw ↑
arazzo: 1.0.1
info:
  title: Amazon S3 Get Object or Create It
  summary: Check whether an object exists with HEAD and upload it only if missing.
  description: >-
    An idempotent write pattern for Amazon S3. The workflow probes for an object
    with a HEAD request and branches: when the object already exists it ends and
    reports the existing ETag, and when the object is missing it uploads the
    supplied body with a PUT. This avoids overwriting data that is already in
    place. 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: objectsApi
  url: ../openapi/amazon-s3-objects-api-openapi.yml
  type: openapi
workflows:
- workflowId: get-or-create-object
  summary: Upload an object only when it does not already exist.
  description: >-
    Uses HeadObject to detect the presence of an object and only writes it with
    PutObject when the object is not found.
  inputs:
    type: object
    required:
    - bucket
    - objectKey
    - objectBody
    properties:
      bucket:
        type: string
        description: The bucket that holds (or will hold) the object.
      objectKey:
        type: string
        description: The key to check for and conditionally write.
      objectBody:
        type: string
        description: The raw object payload to upload when the object is missing.
  steps:
  - stepId: headObject
    description: >-
      Probe for the object with a HEAD request. A 200 means it exists; a 404
      means it must be created.
    operationId: HeadObject
    parameters:
    - name: Bucket
      in: path
      value: $inputs.bucket
    - name: Key+
      in: path
      value: $inputs.objectKey
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      existingEtag: $response.header.ETag
    onSuccess:
    - name: alreadyExists
      type: end
      criteria:
      - condition: $statusCode == 200
    onFailure:
    - name: notFoundCreate
      type: goto
      stepId: putObject
      criteria:
      - condition: $statusCode == 404
  - stepId: putObject
    description: >-
      Upload the object's binary body because the HEAD request reported it was
      not present.
    operationId: PutObject
    parameters:
    - name: Bucket
      in: path
      value: $inputs.bucket
    - name: Key+
      in: path
      value: $inputs.objectKey
    requestBody:
      contentType: application/octet-stream
      payload: $inputs.objectBody
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      createdEtag: $response.header.ETag
      versionId: $response.header.x-amz-version-id
  outputs:
    existingEtag: $steps.headObject.outputs.existingEtag
    createdEtag: $steps.putObject.outputs.createdEtag

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/amazon-s3-get-or-create-object-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.