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

# Toggle Workflow

> Turn a Workflow on or off

Flips `is_active`. Turning a Workflow on runs an immediate pass that records
current membership without firing, the same behavior as creating it active for
the first time. Turning on a Workflow over an existing view therefore sends no
notifications for records that were already there.

```bash cURL theme={null}
curl -X POST "https://api.clustr-ai.com/api/public/workflows/7f1e2a33-.../toggle" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

```json 200 theme={null}
{
  "success": true,
  "data": {
    "workflow": {
      "clustr_workflow_id": "wf_6zzpxenvr4b2ya4598bgvgk7dg",
      "id": "7f1e2a33-...",
      "is_active": false
    },
    "message": "Workflow toggled successfully"
  }
}
```

```json 404 theme={null}
{
  "success": false,
  "error": { "message": "workflow not found", "code": "NOT_FOUND" }
}
```


## OpenAPI

````yaml POST /workflows/{id}/toggle
openapi: 3.1.0
info:
  title: Clustr Public API
  description: >
    Programmatic access to your Clustr network: import connectors, search warm
    intros (opportunities), and manage target accounts.


    ## Authentication

    All endpoints require a Bearer token (API key) in the `Authorization`
    header.


    ```

    Authorization: Bearer <your_api_key>

    ```


    API keys can be created and managed from the [API settings
    page](https://app.clustr-ai.com/api).
  version: '1.0'
  contact:
    name: Clustr Support
    url: https://clustr-ai.com
servers:
  - url: https://api.clustr-ai.com/api/public
    description: Production
security:
  - BearerAuth: []
paths:
  /workflows/{id}/toggle:
    post:
      tags:
        - Workflows
      summary: Toggle Workflow
      description: >-
        Turns a Workflow on or off. Turning one on immediately records the
        view's current members as a starting point, as creating a Workflow does,
        so only later changes trigger an action.
      operationId: toggleWorkflow
      parameters:
        - name: id
          description: >-
            The Workflow's Clustr ID (`wf_…`). The id from earlier responses
            also works.
          in: path
          required: true
          schema:
            type: string
          example: wf_y975qtckww9js3b8p5a5jf6wnx
      responses:
        '200':
          description: The Workflow, with `is_active` switched
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  data:
                    type: object
                    properties:
                      workflow:
                        $ref: '#/components/schemas/Workflow'
        '401':
          description: Invalid or missing API key
        '404':
          description: No such Workflow
components:
  schemas:
    Workflow:
      type: object
      description: >-
        A Workflow triggered by a saved view: it acts on records as they enter
        or leave the view, or on a schedule.
      required:
        - id
        - name
      properties:
        clustr_workflow_id:
          type: string
          description: >-
            The Workflow's Clustr ID, for example
            `wf_01afk2wz00yrbyda280rhtz7tc`. Use it to refer to this

            Workflow.
          example: wf_01afk2wz00yrbyda280rhtz7tc
        clustr_workspace_id:
          type: string
          description: >-
            The workspace's Clustr ID, for example
            `ten_7z5tpty5g2bh41zrdr9ccyp75k`.
          example: ten_7z5tpty5g2bh41zrdr9ccyp75k
        clustrViewId:
          type: string
          description: |-
            The Clustr ID of the saved view the Workflow watches, for example
            `view_57t0m43h0bwxfw1nc7p3800xrq`.
          example: view_57t0m43h0bwxfw1nc7p3800xrq
        id:
          type: string
          format: uuid
          description: >-
            Kept for integrations built before Clustr IDs. New integrations
            should use `clustr_workflow_id`.
        tenant_id:
          type: string
          format: uuid
          description: >-
            Kept for integrations built before Clustr IDs. New integrations
            should use `clustr_workspace_id`.
        name:
          type: string
        description:
          type: string
          nullable: true
        is_active:
          type: boolean
        viewId:
          type: string
          format: uuid
          description: >-
            Kept for integrations built before Clustr IDs. New integrations
            should use `clustrViewId`.
        entity:
          type: string
          enum:
            - accounts
            - people
        'on':
          type: string
          enum:
            - enter
            - leave
            - schedule
        schedule_cron:
          type: string
          nullable: true
          description: >-
            The schedule, as a 5-field cron expression. Set only when `on` is
            `schedule`.
        memberCount:
          type: integer
          description: How many records are currently in the view.
        last_run_at:
          type: string
          format: date-time
          nullable: true
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: The API key you created on the API settings page of the Clustr app.

````

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