---
title: "Create workflow variable"
method: POST
path: "/public/v1/workflows/{workflowId}/variables"
tags: ["Workflow Variables"]
---

# Create workflow variable

`POST /public/v1/workflows/{workflowId}/variables`

Creates a variable for an automation workflow. Requires a USER API key.

## Path parameters

- `workflowId` number, nullable

## Request body

- PublicWorkflowVariableCreateInput
  - `name` string, required
  - `description` string, nullable
  - `pattern` string, nullable

## Response `201`

Created variable

- Variable
  - `id` number, required
  - `name` string, required
  - `description` string, nullable
  - `status` 'ACTIVE' | 'DELETED', required
  - `createdAt` string, required
  - `updatedAt` string, required
  - `assistantId` string, nullable
  - `automationId` number, nullable
  - `pattern` string, nullable
  - `defaultValue` string, nullable
  - `isDefault` boolean, required

---

[API](https://skmtc.net/getfrontline/apis/public-api.md) · [All operations](https://skmtc.net/getfrontline/apis/public-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/getfrontline/public-api/versions/9d33b6aad674/schema)
