---
title: "POST /base/{baseId}/workflow/{workflowId}/logic"
method: POST
path: "/base/{baseId}/workflow/{workflowId}/logic"
tags: ["automation"]
---

# POST /base/{baseId}/workflow/{workflowId}/logic

`POST /base/{baseId}/workflow/{workflowId}/logic`

Create a automation workflow logic

## Request body

- object
  - `name` string — name of the node
  - `description` string — description of the node
  - `config` unknown
  - `parentNodeId` string, required — witch node this the parent, if not provided, it is a root node
  - `type` 'condition' | 'Repeat', required — type of logic

## Response `201`

Successful created

- object
  - `logic` union, required
    - object
      - `name` string — name of the node
      - `description` string — description of the node
      - `config` object, required
        - `conditions` object, required
      - `id` string, required — node id
      - `category` 'logic', required
      - `testResult` object — action test result
        - `spent` number — spent time
        - `inputRaw` unknown
        - `outputRaw` unknown
        - `inputVariables` object — The variables snapshot when executed
        - `outputVariables` object — The variables snapshot when executed
        - `errorMsg` string
        - `createdTime` string, required
      - `outputVariables` object — output variables
      - `inputVariables` object — input variables
      - `createdTime` string, nullable — created time
      - `lastModifiedTime` string, nullable — last modified time
      - `type` 'condition', required — Condition logic
    - object
      - `name` string — name of the node
      - `description` string — description of the node
      - `config` object, required
        - `fact` union, required
          - object
            - `resolvable` true, required — Need be resolved to static values before running
            - `type` 'literal', required
            - `value` unknown
          - object
            - `resolvable` true, required — Need be resolved to static values before running
            - `type` 'fact', required
            - `path` string — json-path syntax
            - `keyStack` string[] — save select stack
            - `params` object
              - …
            - `fact` string, required — Fact name, actionId or triggerId
          - object
            - `resolvable` true, required — Need be resolved to static values before running
            - `type` 'array', required
            - `nodes` union[], required — Array of literal and fact nodes, all value will be stringify and join together
              - …
          - unknown
      - `id` string, required — node id
      - `category` 'logic', required
      - `testResult` object — action test result
        - `spent` number — spent time
        - `inputRaw` unknown
        - `outputRaw` unknown
        - `inputVariables` object — The variables snapshot when executed
        - `outputVariables` object — The variables snapshot when executed
        - `errorMsg` string
        - `createdTime` string, required
      - `outputVariables` object — output variables
      - `inputVariables` object — input variables
      - `createdTime` string, nullable — created time
      - `lastModifiedTime` string, nullable — last modified time
      - `type` 'Repeat', required — Actions in this group will repeat for each item in the input list.
  - `controls` union[], required — workflow control nodes, contains the logic branch and the end node
    - union
      - object
        - `name` string — name of the node
        - `config` object, required
          - `sourceNodeId` string, required
        - `id` string, required — node id
        - `category` 'control', required
        - `createdTime` string, nullable — created time
        - `lastModifiedTime` string, nullable — last modified time
        - `type` 'conditionEnd' | 'triggerEnd' | 'repeatEnd', required
      - object
        - `name` string — name of the node
        - `config` object, required
          - `truthy` boolean, required
          - `sourceNodeId` string, required
        - `id` string, required — node id
        - `category` 'control', required
        - `outputVariables` object — output variables
        - `inputVariables` object — input variables
        - `createdTime` string, nullable — created time
        - `lastModifiedTime` string, nullable — last modified time
        - `type` 'conditionBranch', required — all logic category is actually a group, so they need a node for end mark

---

[API](https://skmtc.net/teable/apis/teable-app.md) · [All operations](https://skmtc.net/teable/apis/teable-app/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/teable/teable-app/versions/7515f3b33d79/schema)
