---
title: "Create a variable on a plan item asynchronously"
method: POST
path: "/cmmn-runtime/plan-item-instances/{planItemInstanceId}/variables-async"
tags: ["Plan Item Instances"]
---

# Create a variable on a plan item asynchronously

`POST /cmmn-runtime/plan-item-instances/{planItemInstanceId}/variables-async`

## Request

- Base URL: `https://developer-docs.flowable.com/cmmn-api`
- URL: `https://developer-docs.flowable.com/cmmn-api/cmmn-runtime/plan-item-instances/{planItemInstanceId}/variables-async`
- Auth: HTTP basic
- TypeScript: <https://skmtc.dev/flowable/apis/flowable-cmmn-rest-api/docs/cmmn-runtime/plan-item-instances/:planItemInstanceId/variables-async/post.ts> (a function with typed inputs; its response is checked against the schema)

This endpoint can be used in 2 ways: By passing a JSON Body (RestVariable) or by passing a multipart/form-data Object.
NB: Swagger V2 specification does not support this use case that is why this endpoint might be buggy/incomplete if used with other tools.

## Path parameters

- `planItemInstanceId` string, required

## Request body

- PlanItemInstanceVariableCollectionResource

## Response `201`

Indicates the job to create a variable is created.

## Other responses

- `400`: Indicates the request body is incomplete or contains illegal values. The status description contains additional information about the error.
- `404`: Indicates the plan item instance does not have a variable with the given name. Status description contains additional information about the error.
- `409`: Indicates the plan item instance already contains a variable with the given name. Use the update-method instead.

---

[API](https://skmtc.dev/flowable/apis/flowable-cmmn-rest-api.md) - [All operations](https://skmtc.dev/flowable/apis/flowable-cmmn-rest-api/llms.txt) - [OpenAPI document](https://skmtc.dev/flowable/apis/flowable-cmmn-rest-api/revisions/afdfa1fcacd0?raw)
