Endpoint
Request Format
| Field | Type | Required | Description |
|---|---|---|---|
sessionId | string | Yes | Workflow from Idea → Intent → Platform → Payment. |
transactionSignature | string | No | Solana tx signature; if provided, it is verified before execution. For Dodo, usually omitted; webhook sets dodoPaymentId. |
platform | string | No | Fallback if context.selectedPlatform is missing (e.g. after redirect). |
Example (Solana)
Example (Dodo)
Response Format
Success (200)
| Field | Type | Description |
|---|---|---|
status | "success" | |
stage | "execution" | |
execution_result | object | See below. |
next_stage | "completion" |
| Field | Type | Description |
|---|---|---|
agents_executed | string[] | e.g. ProductManager, FrontendDev, BackendDev, DevOpsEngineer, ToolManager. |
deliverables | array | { type, content, format, path?, agent? } per file. |
total_cost_script | number | Amount charged. |
execution_time_minutes | number | Rounded from seconds. |
review_passed | boolean | From ReviewAgent; optional. |
review_issues | string[] | From ReviewAgent; optional. |
Example
Error (4xx / 5xx)
| Field | Description |
|---|---|
status | "error" |
stage | "execution" |
error | Message. |
Status Codes / Error Causes
| HTTP | Cause |
|---|---|
| 400 | sessionId missing; workflow context not found and recovery failed; selectedPlatform missing; refinedRequirements missing and no idea to build minimal; transactionSignature invalid. |
| 405 | Method not POST. |
| 503 | One or more agents disabled via admin; error lists disabled agents. |
| 500 | executeX402Workflow (OpenRouter, platform-templates), verifyTransaction, or DB/Prisma error. |
Implementation Notes
- Context: Uses
getWorkflowContextDBthengetWorkflowContext. If missing, can rebuild fromprisma.workflowor create a minimal context whenplatformis provided.platformOptionsandrefinedRequirementsare restored from DB/body/ideawhen possible. - Payment: If
transactionSignatureis present,verifyTransaction(transactionSignature)inlib/solanais called; on failure, 400. For Dodo, execution proceeds whendodoPaymentId/paymentMethod: 'dodo'are set (by webhook). - Agents:
agentsToExecutecomes fromplatformOptionsforselectedPlatform, or defaults (e.g. ProductManager, FrontendDev, BackendDev; + DevOpsEngineer for Android/iOS). Each is checked withisAgentEnabled(agentName); if any are disabled, 503. - Execution:
executeX402Workflow(selectedPlatform, refinedRequirements, sessionId, agentsToExecute, workflowContext)inlib/openairunsgeneratePlatformDeliverables, review, deduplication, etc.workflowContextincludesidea,analysis,answers,platformOptions,selectedPlatform,paymentDetails,supabaseIntegration. - Side effects: Updates
WorkflowwithexecutionResultandcurrentStage: 'execution'; updatesAgentStatper agent; createsTransactionand can updateUser.totalSpentfor Solana payments.