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

# Get workflow blocks

> List the block types available to build a workflow `plan`. Each block is a workflow step; use its `id` as a plan node's `blockId` and configure its inputs (discover them with `GET /v1/workflows/blocks/{blockId}`).

A workflow is a DAG of nodes described by the `plan` object: `{ name?, nodes: [] }`.
Each node has a stable string `id` and a `next` array of node ids it points to (an empty string `""` marks an unwired slot). There are three node `kind`s:

- `BLOCK` — one workflow step. `{ id, kind: "BLOCK", blockId, inputs: {}, next: [] }`. `blockId` comes from `GET /v1/workflows/blocks`; `inputs` are the block's configurable inputs (discover them with `GET /v1/workflows/blocks/{blockId}`). A BLOCK has exactly one `next` slot, except the `WAIT_FOR_APPROVAL` block which has two: `[approvedTargetId, rejectedTargetId]`.
- `CONDITIONAL` — branches the stream. `{ id, kind: "CONDITIONAL", conditions: [], fallbackName?, next: [] }`. Each condition is EITHER a field predicate `{ field, operator, value? }` (lead/company/AI-variable fields — discover them with `GET /v1/workflows/condition-fields`) OR a random-split branch `{ type: "RANDOM_SPLIT", percentage }` (deterministic A/B split; integer 1-100, percentages must sum to ≤ 100 across the node, the remainder falls through to the fallback). `next` has exactly `conditions.length + 1` entries: one target per matched condition (in order) then the fallback target LAST.
- `KING` — dedupes/groups the stream. `{ id, kind: "KING", groupBy, orderBy, checkAnyDomain?, limit?, next: [] }`. `next` is `[leftTargetId, rightTargetId]`.

The first node (the one no other node points to) should be a selector/import entry block. A plan may hold at most 60 nodes and no cycles. An empty plan (`nodes: []`) is valid for a brand-new draft.
Field/entity prefixes used inside conditions: `company.`, `anyLead.`, and `webhookInput.` for webhook-triggered workflows.

    > **Required scope:** `WORKFLOWS_READ`
    >
    > **Rate limit:** 100 requests per minute



## OpenAPI

````yaml https://openapi.enginy.ai/definitions.json get /v1/workflows/blocks
openapi: 3.1.0
info:
  title: Enginy API
  version: 1.0.0
  description: Public API for Enginy platform
servers:
  - url: https://openapi.enginy.ai
    description: Configured server
security: []
tags:
  - name: AI Variables
    description: >-
      Manage AI variables and discover the entity fields you can reference in
      prompts and entity requests.
  - name: Inbox
    description: >-
      Inbox endpoints for listing contact threads, reading thread messages,
      managing tags, and sending manual replies.
  - name: Workflows
    description: >-
      Build, validate, publish, run, and inspect advanced (graph) workflows,
      plus the block/condition catalog needed to author a workflow plan.
paths:
  /v1/workflows/blocks:
    get:
      tags:
        - Workflows
      summary: Get workflow blocks
      description: >-
        List the block types available to build a workflow `plan`. Each block is
        a workflow step; use its `id` as a plan node's `blockId` and configure
        its inputs (discover them with `GET /v1/workflows/blocks/{blockId}`).


        A workflow is a DAG of nodes described by the `plan` object: `{ name?,
        nodes: [] }`.

        Each node has a stable string `id` and a `next` array of node ids it
        points to (an empty string `""` marks an unwired slot). There are three
        node `kind`s:


        - `BLOCK` — one workflow step. `{ id, kind: "BLOCK", blockId, inputs:
        {}, next: [] }`. `blockId` comes from `GET /v1/workflows/blocks`;
        `inputs` are the block's configurable inputs (discover them with `GET
        /v1/workflows/blocks/{blockId}`). A BLOCK has exactly one `next` slot,
        except the `WAIT_FOR_APPROVAL` block which has two: `[approvedTargetId,
        rejectedTargetId]`.

        - `CONDITIONAL` — branches the stream. `{ id, kind: "CONDITIONAL",
        conditions: [], fallbackName?, next: [] }`. Each condition is EITHER a
        field predicate `{ field, operator, value? }` (lead/company/AI-variable
        fields — discover them with `GET /v1/workflows/condition-fields`) OR a
        random-split branch `{ type: "RANDOM_SPLIT", percentage }`
        (deterministic A/B split; integer 1-100, percentages must sum to ≤ 100
        across the node, the remainder falls through to the fallback). `next`
        has exactly `conditions.length + 1` entries: one target per matched
        condition (in order) then the fallback target LAST.

        - `KING` — dedupes/groups the stream. `{ id, kind: "KING", groupBy,
        orderBy, checkAnyDomain?, limit?, next: [] }`. `next` is `[leftTargetId,
        rightTargetId]`.


        The first node (the one no other node points to) should be a
        selector/import entry block. A plan may hold at most 60 nodes and no
        cycles. An empty plan (`nodes: []`) is valid for a brand-new draft.

        Field/entity prefixes used inside conditions: `company.`, `anyLead.`,
        and `webhookInput.` for webhook-triggered workflows.

            > **Required scope:** `WORKFLOWS_READ`
            >
            > **Rate limit:** 100 requests per minute
      parameters:
        - schema:
            type: string
            description: Filter by block category (e.g. IMPORT, ENRICH, ACTIONS).
          required: false
          description: Filter by block category (e.g. IMPORT, ENRICH, ACTIONS).
          name: category
          in: query
        - schema:
            type: string
            description: Case-insensitive match on block name/description.
          required: false
          description: Case-insensitive match on block name/description.
          name: search
          in: query
      responses:
        '200':
          description: Workflow blocks retrieved successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    enum:
                      - success
                  message:
                    type: string
                  data:
                    type: object
                    properties:
                      data:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: string
                            name:
                              type: string
                            category:
                              type: string
                            description:
                              type: string
                            chainable:
                              type: boolean
                            inputs:
                              type: array
                              items:
                                type: object
                                properties:
                                  key:
                                    type: string
                                  required:
                                    type: boolean
                                  hasDefault:
                                    type: boolean
                                required:
                                  - key
                                  - required
                                  - hasDefault
                            outputs:
                              type:
                                - string
                                - 'null'
                            usedApis:
                              type: array
                              items:
                                type: string
                          required:
                            - id
                            - name
                            - category
                            - chainable
                            - inputs
                            - outputs
                            - usedApis
                      meta:
                        type: object
                        properties:
                          total:
                            type: number
                        required:
                          - total
                    required:
                      - data
                      - meta
                required:
                  - status
                  - message
                  - data
        '403':
          description: >-
            Advanced workflows are not enabled for this workspace. Ask your
            workspace admin to enable the feature.
      security:
        - apiKey: []
components:
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key

````