> ## Documentation Index
> Fetch the complete documentation index at: https://docs.opennous.cloud/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a workflow

> A trigger and ordered steps. Enabled by default.

<Note>
  Workflows are in beta. Today the runner executes the first agent step and the first send step. Email and webhook sends are delivered. A Slack step is recorded, but Slack delivery is not wired yet. Other step types are validated and saved but not executed yet.
</Note>

Send a `trigger` and `steps`. Each is `{ type, ...settings }`. See [list triggers and steps](/public-api/workflows/triggers) for the types.

```bash theme={"theme":{"light":"github-light-default","dark":"vesper"}}
curl -X POST https://api.opennous.cloud/v2/workflows \
  -H "Authorization: Bearer $NOUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Daily pipeline digest",
    "trigger": { "type": "clock", "frequency": "daily", "at": "08:00" },
    "steps": [
      { "type": "agent", "prompt": "Summarise what moved in the pipeline since yesterday." },
      { "type": "email", "to": "team@yourco.com" }
    ]
  }'
```

A new workflow is enabled unless you send `enabled: false`. Enabled workflows count toward your plan's automation limit.


## OpenAPI

````yaml POST /v2/workflows
openapi: 3.1.0
info:
  title: OpenNous REST API
  version: 2.0.0
  description: >-
    Read and write the OpenNous revenue context graph over HTTP. Authenticate
    with a workspace API key.
servers:
  - url: https://api.opennous.cloud
    description: OpenNous Cloud
security:
  - bearerAuth: []
  - apiKeyHeader: []
tags:
  - name: People
  - name: Accounts
  - name: Deals
  - name: Notes
  - name: Attention
  - name: Insights
  - name: Enrich & score
  - name: Organization
  - name: Workflows
  - name: Webhooks
    description: >-
      Subscribe to events and have them pushed to your own stack, with the
      account record attached.
  - name: Usage
paths:
  /v2/workflows:
    post:
      tags:
        - Workflows
      summary: Create a workflow
      description: A trigger and ordered steps. Enabled by default.
      operationId: createWorkflow
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                trigger:
                  $ref: '#/components/schemas/WorkflowTrigger'
                steps:
                  type: array
                  items:
                    $ref: '#/components/schemas/WorkflowStep'
                enabled:
                  type: boolean
              required:
                - trigger
            example:
              name: Daily pipeline digest
              trigger:
                type: clock
                frequency: daily
                at: '08:00'
              steps:
                - type: agent
                  prompt: Summarise what moved in the pipeline since yesterday.
                - type: email
                  to: team@yourco.com
      responses:
        '201':
          description: The workflow.
          content:
            application/json:
              schema:
                type: object
                properties:
                  workflow:
                    $ref: '#/components/schemas/Workflow'
              example:
                workflow:
                  id: 6a5b4c3d-2e1f-4a0b-9c8d-7e6f5a4b3c2d
                  name: Daily pipeline digest
                  enabled: true
                  trigger:
                    type: clock
                    frequency: daily
                    at: '08:00'
                  steps_count: 2
                  last_run_at: null
                  created_at: '2026-09-30T10:00:00Z'
                  steps:
                    - id: step_1
                      type: agent
                      prompt: Summarise what moved in the pipeline since yesterday.
                    - id: step_2
                      type: email
                      to: team@yourco.com
                  owner_user_id: u1
                  updated_at: '2026-09-30T10:00:00Z'
                  artifact: null
                  prompt: Summarise what moved in the pipeline since yesterday.
                  destination: email
        '400':
          description: The workflow is invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                invalid_workflow:
                  summary: invalid_workflow
                  value:
                    error: invalid_workflow
                    detail: trigger must be an object with a type.
                    reasons:
                      - code: trigger_required
                        message: trigger must be an object with a type.
                unknown_field:
                  summary: unknown_field
                  value:
                    error: unknown_field
                    detail: 'unsupported field(s): schedule'
                    supported:
                      - name
                      - trigger
                      - steps
                      - enabled
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          description: >-
            The plan's automation limit is reached, or a step needs a feature
            the plan lacks.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                automation_limit_reached:
                  summary: automation_limit_reached
                  value:
                    error: automation_limit_reached
                    limit: 3
                    current_plan: Starter
                ops:
                  summary: upgrade_required
                  value:
                    error: upgrade_required
                    reason: ops_limit_reached
        '403':
          $ref: '#/components/responses/ReadOnlyKey'
        '409':
          description: >-
            The database needs an update before multi-step workflows can be
            saved.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: needs_migration
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  schemas:
    WorkflowTrigger:
      type: object
      required:
        - type
      description: >-
        `type` plus its settings. `clock` takes `frequency` (default `daily`)
        and `at` (`HH:MM`, default `08:00`). `before_meeting` takes `offset` in
        minutes (default 30).
      properties:
        type:
          type: string
          enum:
            - call_ended
            - before_meeting
            - email_received
            - reply_owed
            - thread_quiet
            - health_changed
            - posthog_event
            - champion_quiet
            - committee_joined
            - icp_tier_changed
            - expansion_signal
            - promise_overdue
            - deal_stage_changed
            - deal_closed_won
            - deal_closed_lost
            - deal_stalled
            - deal_created
            - clock
            - webhook_in
            - manual
      additionalProperties: true
    WorkflowStep:
      type: object
      required:
        - type
      description: >-
        `type` plus its settings. An `agent` step takes `artifact`
        (`account_summary`, `call_summary`, `call_score`) or `prompt`. `email`
        takes `to`, `cc`, `subject`, `body`. `slack` takes `channel`, `text`.
        `webhook` takes `url`.
      properties:
        id:
          type: string
        type:
          type: string
          enum:
            - agent
            - hubspot
            - gmail
            - slack
            - email
            - webhook
            - only_if
            - wait
            - approval
      additionalProperties: true
    Workflow:
      allOf:
        - $ref: '#/components/schemas/WorkflowSummary'
        - type: object
          properties:
            steps:
              type: array
              items:
                $ref: '#/components/schemas/WorkflowStep'
            owner_user_id:
              type:
                - string
                - 'null'
            updated_at:
              type:
                - string
                - 'null'
            artifact:
              type:
                - string
                - 'null'
              description: 'What the runner executes: the first agent step''s artifact.'
            prompt:
              type:
                - string
                - 'null'
              description: 'What the runner executes: the first agent step''s prompt.'
            destination:
              type: string
              enum:
                - none
                - slack
                - email
                - webhook
              description: 'What the runner delivers to: the first send step.'
    Error:
      type: object
      description: >-
        Every error response. `error` is a stable machine code. Some errors add
        fields such as `detail`, `supported`, `max`, or `reason`.
      required:
        - error
      properties:
        error:
          type: string
          description: Machine-readable error code.
        detail:
          type: string
          description: Human-readable explanation, when there is one.
      additionalProperties: true
    WorkflowSummary:
      type: object
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
        enabled:
          type: boolean
        trigger:
          $ref: '#/components/schemas/WorkflowTrigger'
        steps_count:
          type: integer
        last_run_at:
          type:
            - string
            - 'null'
        created_at:
          type:
            - string
            - 'null'
  responses:
    Unauthorized:
      description: Missing, unknown, or expired API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            missing:
              summary: api_key_required
              value:
                error: api_key_required
            invalid:
              summary: invalid_api_key
              value:
                error: invalid_api_key
            expired:
              summary: api_key_expired
              value:
                error: api_key_expired
                detail: >-
                  This API key has expired. Create or rotate a key to get a
                  fresh one.
    ReadOnlyKey:
      description: A read-only key called a write endpoint.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: read_only_key
            detail: >-
              This API key is read-only — it can read context but cannot record,
              modify, connect, or send. Use a read/write key for write
              operations.
    RateLimited:
      description: More than 600 requests in a minute on this key.
      headers:
        RateLimit-Limit:
          schema:
            type: integer
          description: Requests allowed per window.
        RateLimit-Remaining:
          schema:
            type: integer
          description: Requests left in the window.
        RateLimit-Reset:
          schema:
            type: integer
          description: Seconds until the window resets.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: rate_limited
    InternalError:
      description: Unexpected server error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: internal_error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Workspace API key. Create one in **Settings → API keys**.
    apiKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key
      description: The same key, sent as a header.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.