---
title: "Create or Update Workflow"
method: POST
path: "/v1/public/workflows"
tags: ["Workflows"]
---

# Create or Update Workflow

`POST /v1/public/workflows`

## Request body

- PublicWorkflowRequest
  - `external_id` string, nullable
  - `title` string, nullable
  - `description` string, nullable
  - `status` string, nullable
  - `trigger_type` string, nullable
  - `trigger_every` integer, nullable
  - `is_trigger_active` boolean, nullable
  - `nodes` WorkflowNodeInput[]
    - `id` string, nullable
    - `action_uid` string, nullable
    - `action_slug` string, nullable
    - `action_id` string, nullable
    - `is_base` boolean, nullable
    - `input_data` object, nullable
    - `predefined_input` object, nullable
    - `previous_output_data` object, nullable
    - `user_display_name` string, nullable
    - `integration_slug` string, nullable
    - `integration_id` string, nullable
    - `cost_minutes` integer, nullable
    - `valid_to_run` boolean, nullable
    - `condition_groups` WorkflowConditionGroupInput[]
      - `id` string, nullable
      - `operator` string
      - `parent_group_id` string, nullable
      - `conditions` WorkflowConditionInput[]
        - `id` string, nullable
        - `object_type` string, nullable
        - `record_source` string, nullable
        - `record_ids` string, nullable
        - `field_name` string, nullable
        - `operator` string, nullable
        - `value_type` string, nullable
        - `value_text` string, nullable
        - `value_number` number, nullable
        - `value_date` string, nullable
        - `value_datetime` string, nullable
        - `extra_condition` object, nullable
  - `config` object, nullable
  - `type` string, nullable

## Response `200`

OK

- PublicWorkflowResponse
  - `ok` boolean, required
  - `status` string, required
  - `external_id` string, required
  - `workflow_id` string, required
  - `valid_to_run` boolean, required
  - `node_count` integer, required
  - `ctx_id` string, nullable

## Other responses

- `400` — Bad Request
- `403` — Forbidden
- `404` — Not Found
- `500` — Internal Server Error

---

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