---
title: "Workflows"
description: "Draft and published workflows for one app and environment. The graph is the same one the canvas saves."
canonical: https://docs.notifiable.sh/api/workflows
source: https://docs.notifiable.sh/api/workflows.md
---

# Workflows

Draft and published workflows for one app and environment. The graph is the same one the canvas saves.

These routes are the public API. Send `Authorization: Bearer` with a workspace server API key. The key can act on every app in the workspace. A route that names an app uses that app id. `environment` is `development` or `production`.

## `GET /api/v1/public/apps/{app}/environments/{environment}/workflows`

The workflows were listed.

Path

- `app` — App id in this workspace.
- `environment` — `development` or `production`.

Responses

- `200` `WORKFLOWS_LISTED` — The workflows were listed.
- `401` `INVALID_API_KEY` — The API key is invalid.
- `404` `APP_NOT_FOUND` — The app could not be found.
- `429` `RATE_LIMIT_EXCEEDED` — Too many requests. Please try again later.
- `500` `SERVER_ERROR` — Something went wrong. Please try again.

## `POST /api/v1/public/apps/{app}/environments/{environment}/workflows`

The workflow was created.

Path

- `app` — App id in this workspace.
- `environment` — `development` or `production`.

Responses

- `201` `WORKFLOW_CREATED` — The workflow was created.
- `401` `INVALID_API_KEY` — The API key is invalid.
- `404` `APP_NOT_FOUND` — The app could not be found.
- `422` `VALIDATION_FAILED` — The request contains invalid fields.
- `429` `RATE_LIMIT_EXCEEDED` — Too many requests. Please try again later.
- `500` `SERVER_ERROR` — Something went wrong. Please try again.

## `DELETE /api/v1/public/apps/{app}/environments/{environment}/workflows/{workflow}`

The workflow was deleted.

Path

- `app` — App id in this workspace.
- `environment` — `development` or `production`.
- `workflow` — Workflow id.

Responses

- `200` `WORKFLOW_DELETED` — The workflow was deleted.
  - `id` (string, required)
- `401` `INVALID_API_KEY` — The API key is invalid.
- `404` `RESOURCE_NOT_FOUND` — The requested resource could not be found.
- `429` `RATE_LIMIT_EXCEEDED` — Too many requests. Please try again later.
- `500` `SERVER_ERROR` — Something went wrong. Please try again.

## `GET /api/v1/public/apps/{app}/environments/{environment}/workflows/{workflow}`

The workflow was found.

Path

- `app` — App id in this workspace.
- `environment` — `development` or `production`.
- `workflow` — Workflow id.

Responses

- `200` `WORKFLOW_FETCHED` — The workflow was found.
- `401` `INVALID_API_KEY` — The API key is invalid.
- `404` `RESOURCE_NOT_FOUND` — The requested resource could not be found.
- `429` `RATE_LIMIT_EXCEEDED` — Too many requests. Please try again later.
- `500` `SERVER_ERROR` — Something went wrong. Please try again.

## `PATCH /api/v1/public/apps/{app}/environments/{environment}/workflows/{workflow}`

The workflow was updated.

Path

- `app` — App id in this workspace.
- `environment` — `development` or `production`.
- `workflow` — Workflow id.

Body

- `name` (string, optional)
- `nodes` (array of object, optional)
- `basedOn` (string, optional)

Responses

- `200` `WORKFLOW_UPDATED` — The workflow was updated.
- `401` `INVALID_API_KEY` — The API key is invalid.
- `404` `RESOURCE_NOT_FOUND` — The requested resource could not be found.
- `422` `VALIDATION_FAILED` — The request contains invalid fields.
- `429` `RATE_LIMIT_EXCEEDED` — Too many requests. Please try again later.
- `500` `SERVER_ERROR` — Something went wrong. Please try again.

## `POST /api/v1/public/apps/{app}/environments/{environment}/workflows/{workflow}/duplicate`

The workflow was duplicated.

Path

- `app` — App id in this workspace.
- `environment` — `development` or `production`.
- `workflow` — Workflow id.

Responses

- `201` `WORKFLOW_DUPLICATED` — The workflow was duplicated.
- `401` `INVALID_API_KEY` — The API key is invalid.
- `404` `RESOURCE_NOT_FOUND` — The requested resource could not be found.
- `422` `VALIDATION_FAILED` — The request contains invalid fields.
- `429` `RATE_LIMIT_EXCEEDED` — Too many requests. Please try again later.
- `500` `SERVER_ERROR` — Something went wrong. Please try again.

## `POST /api/v1/public/apps/{app}/environments/{environment}/workflows/{workflow}/publish`

The workflow was published.

Path

- `app` — App id in this workspace.
- `environment` — `development` or `production`.
- `workflow` — Workflow id.

Responses

- `200` `WORKFLOW_PUBLISHED` — The workflow was published.
- `401` `INVALID_API_KEY` — The API key is invalid.
- `404` `RESOURCE_NOT_FOUND` — The requested resource could not be found.
- `429` `RATE_LIMIT_EXCEEDED` — Too many requests. Please try again later.
- `500` `SERVER_ERROR` — Something went wrong. Please try again.

## `POST /api/v1/public/apps/{app}/environments/{environment}/workflows/{workflow}/run`

The workflow was started.

Path

- `app` — App id in this workspace.
- `environment` — `development` or `production`.
- `workflow` — Workflow id.

Responses

- `200` `WORKFLOW_STARTED` — The workflow was started.
  - `id` (string, required)
- `401` `INVALID_API_KEY` — The API key is invalid.
- `404` `RESOURCE_NOT_FOUND` — The requested resource could not be found.
- `429` `RATE_LIMIT_EXCEEDED` — Too many requests. Please try again later.
- `500` `SERVER_ERROR` — Something went wrong. Please try again.

## `GET /api/v1/public/apps/{app}/environments/{environment}/workflows/{workflow}/runs`

The workflow runs were listed.

Path

- `app` — App id in this workspace.
- `environment` — `development` or `production`.
- `workflow` — Workflow id.

Query

- `page` (integer)

Responses

- `200` `WORKFLOW_RUNS_LISTED` — The workflow runs were listed.
- `401` `INVALID_API_KEY` — The API key is invalid.
- `404` `RESOURCE_NOT_FOUND` — The requested resource could not be found.
- `422` `VALIDATION_FAILED` — The request contains invalid fields.
- `429` `RATE_LIMIT_EXCEEDED` — Too many requests. Please try again later.
- `500` `SERVER_ERROR` — Something went wrong. Please try again.

## `GET /api/v1/public/apps/{app}/environments/{environment}/workflows/{workflow}/runs/{run}`

The workflow run was found.

Path

- `app` — App id in this workspace.
- `environment` — `development` or `production`.
- `workflow` — Workflow id.
- `run` — Workflow run id.

Responses

- `200` `WORKFLOW_RUN_FETCHED` — The workflow run was found.
- `401` `INVALID_API_KEY` — The API key is invalid.
- `404` `RESOURCE_NOT_FOUND` — The requested resource could not be found.
- `429` `RATE_LIMIT_EXCEEDED` — Too many requests. Please try again later.
- `500` `SERVER_ERROR` — Something went wrong. Please try again.

## `POST /api/v1/public/apps/{app}/environments/{environment}/workflows/{workflow}/unpublish`

The workflow was unpublished.

Path

- `app` — App id in this workspace.
- `environment` — `development` or `production`.
- `workflow` — Workflow id.

Responses

- `200` `WORKFLOW_UNPUBLISHED` — The workflow was unpublished.
- `401` `INVALID_API_KEY` — The API key is invalid.
- `404` `RESOURCE_NOT_FOUND` — The requested resource could not be found.
- `429` `RATE_LIMIT_EXCEEDED` — Too many requests. Please try again later.
- `500` `SERVER_ERROR` — Something went wrong. Please try again.
