Mount API exceptions
mountFlowDropApp() throws synchronously if the mount cannot proceed.
| Error message | Cause | Fix |
|---|---|---|
Container element not found | The selector or element passed to container does not exist in the DOM | Ensure the container element exists before calling mountFlowDropApp() |
Container has no dimensions | The container element has zero width or height | Apply width and height (or min-height) to the container via CSS before mounting |
FlowDrop CSS not imported | The base styles from @flowdrop/flowdrop/styles were not loaded | Import @flowdrop/flowdrop/styles before mounting |
Cannot mount in server-side context | mountFlowDropApp() was called during SSR (no window object) | Guard the call with if (typeof window !== 'undefined') — see Framework Integration |
API error handling
FlowDrop calls your REST API during normal operation. Use theonApiError event handler to intercept these errors.
HTTP status codes
| Status | Cause | Recommended action |
|---|---|---|
0 | Network error — no response received | Check server is running; show connectivity warning |
401 | Unauthorized — missing or expired credentials | Redirect to login or refresh token |
403 | Forbidden — authenticated but not allowed | Show permission error; do not redirect |
404 | Endpoint not found — wrong URL configured | Verify your endpoint configuration |
422 | Validation error — malformed workflow JSON | Log the response body for details |
500 | Server error | Log and surface to user; offer retry |
operation values
The operation argument tells you what FlowDrop was doing when the error occurred:
| Value | Trigger |
|---|---|
loadNodes | Initial GET /nodes request on mount |
loadWorkflow | GET /workflows/:id on mount |
saveWorkflow | POST /workflows or PUT /workflows/:id on save |
loadPortConfig | GET /port-config for dynamic port compatibility |
executeWorkflow | POST /execute (if using the playground) |
Save errors
onSaveError is a separate handler called when a save operation fails. It receives the workflow object that failed to save, allowing you to recover or retry.
Agent Spec validation errors
When exporting a workflow to Agent Spec format viaWorkflowOperationsHelper.exportAsAgentSpec(), the result object indicates success or failure:
Common validation errors
| Error message | Cause | Fix |
|---|---|---|
Workflow has no nodes | The workflow is empty | Add at least one node before exporting |
Cycle detected | The workflow graph contains a loop | Remove cyclic connections; Agent Spec requires a DAG |
Node type not mappable: <type> | A custom node type has no Agent Spec equivalent | Map custom types to Agent Spec actions in your export config |
Disconnected node: <id> | A node has no edges | Connect all nodes or remove unused ones |
Missing required port: <port> | A required input port has no incoming edge | Connect the required port before exporting |