Automations

View Markdown

Introduction

Automations let you define reusable media workflows that can be triggered on demand via the API.

You can run Tasks in parallel — for example, a social media app might check if an image is nsfw, get a summary, and create a small thumbnail image. These don't depend on each other so they can all run at the same time.

You can chain tasks together in sequence — for example, a short video app might transcode each upload, then use that video to create a thumbnail.

You can run tasks conditionally based on file properties — for example, a messaging app might only resize images if they're larger than a certain width.


What is an automation?

An automation has a name, an optional description, a workflow array, and a status.

curl -X POST "https://api.ittybit.com/automations" \
-H "Authorization: Bearer ITTYBIT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
  "name": "Process uploads",
  "description": "Generate summary, thumbnail, and subtitles for all uploads",
  "workflow": [
    { "kind": "summary" },
    { "kind": "image", "options": { "width": 320, "format": "png" } },
    { "kind": "subtitles" }
  ],
  "status": "active"
}'

Automation object

{
  "id": "auto_abcdefgh12345678",
  "object": "automation",
  "name": "Process uploads",
  "description": "Generate summary, thumbnail, and subtitles for all uploads",
  "workflow": [
    { "kind": "summary" },
    { "kind": "image", "options": { "width": 320, "format": "png" } },
    { "kind": "subtitles" }
  ],
  "status": "active",
  "created_at": 1735689825,
  "updated_at": 1735689825
}

Triggering automations

Automations are triggered by sending a POST request to the automation's run endpoint:

curl -X POST "https://api.ittybit.com/automations/auto_abcdefgh12345678/run" \
-H "Authorization: Bearer ITTYBIT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
  "url": "https://example.com/video.mp4"
}'

This creates a new run that executes the automation's workflow against the provided URL.


Automation statuses

StatusDescription
activeAutomation is enabled and can be triggered
pausedAutomation is disabled and cannot be triggered

Workflow structure

The workflow is an array of task definitions. Each task in the workflow uses the same format as Runs:

{
  "workflow": [
    {
      "kind": "video",
      "options": {
        "width": 1280,
        "format": "mp4",
        "quality": "high"
      }
    },
    {
      "kind": "subtitles"
    },
    {
      "kind": "thumbnails"
    }
  ]
}

See Workflows for details on sequential chains, parallel execution, and conditional logic.


API Reference

See the API Reference for the full list of automation endpoints and their parameters.

API Reference

On this page