---
title: "Generate Workflow From Prompt"
method: POST
path: "/v1/scenario/generate-from-prompt"
tags: ["Scenario Builder"]
---

# Generate Workflow From Prompt

`POST /v1/scenario/generate-from-prompt`

Generate a validated React Flow graph from natural language (not persisted). Use ``POST /v1/scenario`` to save.

## Headers

- `X-API-Key` string, required

## Request body

- GenerateWorkflowFromPromptRequest — Generate a React Flow workflow graph from natural language (not persisted).
  - `prompt` string, required — What the workflow should cover (steps, branches, agent vs user lines).
  - `context` string, nullable — Optional product or agent context to steer the layout.

## Response `200`

Successful Response

- GenerateWorkflowFromPromptResponse — Validated graph ready for ``POST /v1/scenario`` ``definition`` field.
  - `definition` object, required — React Flow graph that passed the same validation as create/update.

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/getbluejay/apis/bluejay-api.md) · [All operations](https://skmtc.net/getbluejay/apis/bluejay-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/getbluejay/bluejay-api/revisions/18bc44e35414/schema)
