Generate Workflow

Generate a workflow from a natural language task description. This endpoint uses the workflow-use library's HealingService to: 1. Record browser interactions for the task 2. Convert interactions to a reusable workflow 3. Extract variables for parameterization 4. Save the generated YAML to S3 The generation happens asynchronously via the workflow_worker Lambda.

Authentication

X-Browser-Use-API-Keystring
API Key authentication via header

Path Parameters

workflow_idstringRequiredformat: "uuid"

Request

This endpoint expects an object.
taskPromptstringRequired1-5000 characters
Natural language description of the task to automate
workflowNamestring or nullOptional<=200 characters
Optional name for the generated workflow. If not provided, will be inferred from prompt.
enableVariableExtractionbooleanOptionalDefaults to true
Whether to extract reusable variables from the workflow
useDeterministicConversionbooleanOptionalDefaults to true

Whether to use deterministic conversion (faster and cheaper)

useCloudBrowserbooleanOptionalDefaults to true

Whether to use cloud browser for recording (recommended for production)

enablePatternVariableIdentificationbooleanOptionalDefaults to true

Enable pattern-based variable identification (no LLM, $0 cost)

patternVariableConfidencedoubleOptional0-1Defaults to 0.5

Minimum confidence threshold for pattern-based detection (0.0 to 1.0)

enableAiValidationbooleanOptionalDefaults to false
Enable AI validation to review and fix generated workflow
cleanupYamlbooleanOptionalDefaults to true
Remove verbose fields from generated YAML
removeDescriptionsbooleanOptionalDefaults to true

Remove step descriptions (only if cleanup_yaml=True)

removeVerificationChecksbooleanOptionalDefaults to true

Remove verification_checks (only if cleanup_yaml=True)

removeExpectedOutcomesbooleanOptionalDefaults to true

Remove expected_outcome fields (only if cleanup_yaml=True)

removeAgentReasoningbooleanOptionalDefaults to true

Remove agent_reasoning fields (only if cleanup_yaml=True)

Response

Successful Response
workflowIdstringformat: "uuid"
ID of the workflow that was updated with generated YAML
statusstring or nullDefaults to pending

Status of the generation request (e.g., “pending”, “processing”)

messagestring or nullDefaults to Workflow generation started. This may take a few minutes.

Human-readable message about the generation request

Errors