---
title: "Create an active Automation from an app surface"
method: POST
path: "/v1/automations"
tags: ["Automations"]
---

# Create an active Automation from an app surface

`POST /v1/automations`

Den schedules Automations and keeps durable run history. Automations created by Desktop run on the owner's connected desktop; Automations created by Web run in OpenWork Cloud. If no desktop runner is connected when a desktop occurrence is due, that occurrence is recorded as missed. Creation makes an Automation active immediately and uses the owner's current OpenWork Connect integrations. Deactivation stops future runs but does not cancel a run already in progress. This compatibility route serves first-party Desktop clients. Agents must use createCloudAutomation so they cannot accidentally create Desktop placement.

## Request body

- union
  - object
    - `name` string, required
    - `schedule` union, required
      - object
        - `kind` 'once', required
        - `timezone` string, required
        - `at` integer, required
      - object
        - `kind` 'daily', required
        - `timezone` string, required
        - `hour` integer, required
        - `minute` integer, required
      - object
        - `kind` 'weekly', required
        - `timezone` string, required
        - `daysOfWeek` integer[], required
        - `hour` integer, required
        - `minute` integer, required
    - `action` union, required
      - object
        - `kind` 'agent', required
        - `instructions` string, required
        - `model` object, required
          - `providerId` string, required
          - `modelId` string, required
          - `variant` string, nullable
      - object
        - `kind` 'saved_script', required
        - `script` object, required
          - `pluginId` string, required
          - `configObjectId` string, required
          - `configObjectVersionId` string, required
        - `input` unknown
    - `executionTarget` 'desktop' | 'cloud', required
  - object
    - `name` string, required
    - `instructions` string, required
    - `schedule` union, required
      - object
        - `kind` 'once', required
        - `timezone` string, required
        - `at` integer, required
      - object
        - `kind` 'daily', required
        - `timezone` string, required
        - `hour` integer, required
        - `minute` integer, required
      - object
        - `kind` 'weekly', required
        - `timezone` string, required
        - `daysOfWeek` integer[], required
        - `hour` integer, required
        - `minute` integer, required
    - `model` object, required
      - `providerId` string, required
      - `modelId` string, required
      - `variant` string, nullable
    - `workspaceId` string, nullable

## Response `201`

Active Automation created.

- object
  - `automation` object, required
    - `id` string, required
    - `organizationId` string, required
    - `ownerMemberId` string, required
    - `name` string, required
    - `state` 'active' | 'inactive' | 'needs_attention' | 'archived', required
    - `currentRevisionId` string, required
    - `nextDueAt` integer, nullable, required
    - `latestRunAt` integer, nullable, required
    - `latestSuccessfulRunId` string, nullable
    - `latestSuccessfulResult` unknown
    - `needsAttentionReason` object, nullable, required
      - `code` 'owner_membership_lost' | 'model_access_lost' | 'provider_unavailable' | 'connect_access_unavailable' | 'execution_runtime_unavailable', required
      - `message` string, required
      - `occurredAt` integer, required
    - `createdAt` integer, required
    - `updatedAt` integer, required
    - `archivedAt` integer, nullable, required
  - `revision` object, required
    - `id` string, required
    - `automationId` string, required
    - `version` integer, required
    - `instructions` string, required
    - `schedule` union, required
      - object
        - `kind` 'once', required
        - `timezone` string, required
        - `at` integer, required
      - object
        - `kind` 'daily', required
        - `timezone` string, required
        - `hour` integer, required
        - `minute` integer, required
      - object
        - `kind` 'weekly', required
        - `timezone` string, required
        - `daysOfWeek` integer[], required
        - `hour` integer, required
        - `minute` integer, required
    - `model` object, required
      - `providerId` string, required
      - `modelId` string, required
      - `variant` string, nullable
    - `action` union
      - object
        - `kind` 'agent', required
        - `instructions` string, required
        - `model` object, required
          - `providerId` string, required
          - `modelId` string, required
          - `variant` string, nullable
      - object
        - `kind` 'saved_script', required
        - `script` object, required
          - `pluginId` string, required
          - `configObjectId` string, required
          - `configObjectVersionId` string, required
        - `input` unknown
    - `executionTarget` 'desktop' | 'cloud'
    - `workspaceId` string, nullable
    - `maximumRuntimeMs` integer, required
    - `digest` string, required
    - `createdAt` integer, required
  - `latestRun` object, nullable, required
    - `id` string, required
    - `automationId` string, required
    - `revisionId` string, required
    - `trigger` 'scheduled' | 'recovery' | 'manual', required
    - `scheduledFor` integer, nullable, required
    - `idempotencyKey` string, required
    - `status` 'queued' | 'claimed' | 'running' | 'succeeded' | 'failed' | 'cancelled' | 'skipped', required
    - `leaseOwner` string, nullable, required
    - `leaseExpiresAt` integer, nullable, required
    - `heartbeatAt` integer, nullable, required
    - `attemptCount` integer, required
    - `executionTarget` 'desktop' | 'cloud', required
    - `executionThread` object, nullable, required
      - `id` string, required
      - `threadKind` 'automation', required
      - `executionLocation` 'desktop' | 'cloud', required
      - `automationId` string, required
      - `automationRunId` string, required
      - `engineKind` string, required
      - `nativeThreadId` string, nullable
      - `workspaceId` string, nullable
    - `providerId` string, required
    - `modelId` string, required
    - `modelVariant` string, nullable
    - `startedAt` integer, nullable, required
    - `finishedAt` integer, nullable, required
    - `error` object, nullable, required
      - `code` 'owner_membership_lost' | 'model_access_lost' | 'provider_unavailable' | 'connect_access_unavailable' | 'execution_runtime_unavailable' | 'execution_failed' | 'execution_timed_out' | 'runner_unavailable' | 'cancelled' | 'lease_lost' | 'internal_error', required
      - `message` string, required
      - `retryable` boolean, required
    - `resultSummary` string, nullable, required
    - `codemodeReceiptId` string, nullable
    - `validatedResult` unknown
    - `usage` object, required
      - `inputTokens` integer, nullable, required
      - `outputTokens` integer, nullable, required
      - `costMicros` integer, nullable, required
    - `createdAt` integer, required
    - `updatedAt` integer, required

## Other responses

- `400` — Invalid request.
- `401` — Sign-in required.
- `409` — Cloud runtime or model access is unavailable.

## Changes

> 25 revisions in range; 14 could not be searched.

- **2026-08-30** `571dc4a74532` — 2 info
  - added the new optional request property `anyOf[subschema #2]/workspaceId`
  - added the optional property `revision/workspaceId` to the response with the `201` status
- **2026-08-12** `f973b1b5b4cf` — 1 breaking, 2 warning, 3 info
  - the `executionLocation` response property const value `desktop` was removed for the status `201`
  - added the new `cloud` enum value to the `latestRun/anyOf[subschema #1]/executionThread/anyOf[subschema #1]/executionLocation` response property for the response status `201`
  - added the new `desktop` enum value to the `latestRun/anyOf[subschema #1]/executionThread/anyOf[subschema #1]/executionLocation` response property for the response status `201`
  - added the non-success response with the status `409`
  - …2 more
- **2026-08-11** `0d4ebf20cbde` — 4 breaking, 8 warning, 6 info
  - the request's body type/format changed from `object`/`` to ``/``
  - the response property `revision/executionTarget` became optional for the status `201`
  - the `executionTarget` response property const value `desktop` was removed for the status `201`
  - the `executionTarget` response property const value `desktop` was removed for the status `201`
  - …14 more
- …earlier changes not shown

[Full history](https://skmtc.dev/openworklabs/apis/den-api/changes/v1/automations/post.md)

---

[API](https://skmtc.dev/openworklabs/apis/den-api.md) · [All operations](https://skmtc.dev/openworklabs/apis/den-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/openworklabs/den-api/revisions/571dc4a74532/schema)
