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

# Post base workflow

> Create a automation workflow



## OpenAPI

````yaml /swagger.json post /base/{baseId}/workflow
openapi: 3.0.0
info:
  version: 1.0.0
  title: Teable App
  description: Manage Data as easy as drink a cup of tea
  x-logo:
    backgroundColor: '#F0F0F0'
    altText: Teable logo
servers:
  - url: https://app.teable.ai/api
security: []
paths:
  /base/{baseId}/workflow:
    post:
      tags:
        - automation
      description: Create a automation workflow
      parameters:
        - schema:
            type: string
          required: true
          name: baseId
          in: path
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                description:
                  type: string
                trigger:
                  type: object
                  properties:
                    name:
                      type: string
                      description: name of the node
                    description:
                      type: string
                      description: description of the node
                    config:
                      nullable: true
                      description: node configuration
                    type:
                      type: string
                      enum:
                        - recordCreated
                        - recordUpdated
                        - recordCreatedOrUpdated
                        - recordMatchesConditions
                        - buttonClick
                        - formSubmitted
                        - scheduledTime
                        - webhook
                      description: type of trigger
                  required:
                    - type
      responses:
        '201':
          description: Successful created
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    description: a unique identifier for the workflow
                  baseId:
                    type: string
                    description: the base id of the workflow
                  name:
                    type: string
                    description: the name of the workflow
                  description:
                    type: string
                    description: description of the workflow
                  hasDraft:
                    type: boolean
                    description: has draft of the workflow
                  isActive:
                    type: boolean
                    description: is active of the workflow
                  edges:
                    type: array
                    items:
                      type: object
                      properties:
                        source:
                          type: string
                        target:
                          type: string
                      required:
                        - source
                        - target
                    description: edges of the nodes
                  nodes:
                    type: array
                    items:
                      type: object
                    description: nodes list include trigger and actions
                  createdBy:
                    type: string
                    description: created by user id
                  createdTime:
                    type: string
                    description: created time of the workflow
                  lastModifiedTime:
                    type: string
                    description: last modified time of the workflow
                  lastModifiedBy:
                    type: string
                    description: last modified by user id
                  activeUser:
                    type: object
                    properties:
                      id:
                        type: string
                      name:
                        type: string
                      email:
                        type: string
                      avatar:
                        type: string
                        nullable: true
                    required:
                      - id
                      - name
                      - email
                    description: active user of the workflow
                required:
                  - id
                  - baseId
                  - edges
                  - nodes
                  - createdBy
                  - createdTime
      security:
        - bearerAuth: []
      x-codeSamples:
        - lang: Shell
          source: |-
            curl --request POST \
              --url https://app.teable.ai/api/base/%7BbaseId%7D/workflow \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"name":"string","description":"string","trigger":{"name":"string","description":"string","config":null,"type":"recordCreated"}}'
        - lang: JavaScript
          source: |-
            const url = 'https://app.teable.ai/api/base/%7BbaseId%7D/workflow';
            const options = {
              method: 'POST',
              headers: {
                Authorization: 'Bearer REPLACE_BEARER_TOKEN',
                'content-type': 'application/json'
              },
              body: '{"name":"string","description":"string","trigger":{"name":"string","description":"string","config":null,"type":"recordCreated"}}'
            };

            try {
              const response = await fetch(url, options);
              const data = await response.json();
              console.log(data);
            } catch (error) {
              console.error(error);
            }
        - lang: Node.js
          source: |-
            const http = require('https');

            const options = {
              method: 'POST',
              hostname: 'app.teable.ai',
              port: null,
              path: '/api/base/%7BbaseId%7D/workflow',
              headers: {
                Authorization: 'Bearer REPLACE_BEARER_TOKEN',
                'content-type': 'application/json'
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on('data', function (chunk) {
                chunks.push(chunk);
              });

              res.on('end', function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              name: 'string',
              description: 'string',
              trigger: {name: 'string', description: 'string', config: null, type: 'recordCreated'}
            }));
            req.end();
        - lang: Python
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("app.teable.ai")


            payload =
            "{\"name\":\"string\",\"description\":\"string\",\"trigger\":{\"name\":\"string\",\"description\":\"string\",\"config\":null,\"type\":\"recordCreated\"}}"


            headers = {
                'Authorization': "Bearer REPLACE_BEARER_TOKEN",
                'content-type': "application/json"
            }


            conn.request("POST", "/api/base/%7BbaseId%7D/workflow", payload,
            headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````