Bug Report: workflows/execute endpoint returns 500 "terminated" error
<html>
<body>
<!--StartFragment--><h3 style="color: rgb(200, 200, 200); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(0, 0, 0); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">Summary</h3><p style="display: inline; color: rgb(200, 200, 200); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; font-size: 13px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(0, 0, 0); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">The<span> </span><code style="font-family: monospace; color: rgb(200, 200, 200); background-color: rgba(255, 255, 255, 0.1); padding: 2px 4px; border-radius: 3px; font-size: 0.9em; word-break: break-word;">workflows/execute</code><span> </span>endpoint consistently returns a 500 error with message "terminated" when using<span> </span><code style="font-family: monospace; color: rgb(200, 200, 200); background-color: rgba(255, 255, 255, 0.1); padding: 2px 4px; border-radius: 3px; font-size: 0.9em; word-break: break-word;">fal.stream()</code>, despite following the exact code examples from FAL documentation.</p><span style="color: rgb(200, 200, 200); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; font-size: 13px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(0, 0, 0); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;"></span><h3 style="color: rgb(200, 200, 200); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(0, 0, 0); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">Environment</h3><ul style="padding-inline-start: 1.5em; color: rgb(200, 200, 200); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; font-size: 13px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(0, 0, 0); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"><li><strong>@fal-ai/client version</strong>: 1.7.2</li><li><strong>Node.js version</strong>: 22.15.0</li><li><strong>Platform</strong>: Windows 11</li></ul><h3 style="color: rgb(200, 200, 200); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(0, 0, 0); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">Steps to Reproduce</h3><pre style="overflow-x: auto; max-width: 100%; white-space: pre; padding: 8px; border-radius: 4px; margin: 8px 0px; box-sizing: border-box; color: rgb(200, 200, 200); font-size: 13px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(0, 0, 0); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"><code class="language-typescript" style="font-family: monospace; color: rgb(200, 200, 200); background-color: rgba(255, 255, 255, 0.1); padding: 2px 4px; border-radius: 3px; font-size: 0.9em; word-break: break-word;">import { fal } from "@fal-ai/client";
fal.config({ credentials: "YOUR_FAL_KEY" });
const stream = await fal.stream('workflows/execute', {
input: {
input: {
prompt: "A beautiful sunset over a calm ocean"
},
workflow: {
"input": {
"id": "input",
"type": "input",
"depends": [],
"input": { "prompt": "" }
},
"node_1": {
"id": "node_1",
"type": "run",
"depends": ["input"],
"app": "fal-ai/flux/dev",
"input": { "prompt": "$input.prompt" }
},
"output": {
"id": "output",
"type": "display",
"depends": ["node_1"],
"fields": { "image": "$node_1.images.0" }
}
}
}
});
stream.on("data", (event) => {
console.log(event);
});
const result = await stream.done();
</code></pre><h3 style="color: rgb(200, 200, 200); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(0, 0, 0); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">Expected Behavior</h3><p style="display: inline; color: rgb(200, 200, 200); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; font-size: 13px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(0, 0, 0); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">The workflow should execute, streaming events for each node, and return the final result with the generated image.</p><span style="color: rgb(200, 200, 200); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; font-size: 13px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(0, 0, 0); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;"></span><h3 style="color: rgb(200, 200, 200); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(0, 0, 0); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">Actual Behavior</h3><p style="display: inline; color: rgb(200, 200, 200); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; font-size: 13px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(0, 0, 0); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">Throws<span> </span><code style="font-family: monospace; color: rgb(200, 200, 200); background-color: rgba(255, 255, 255, 0.1); padding: 2px 4px; border-radius: 3px; font-size: 0.9em; word-break: break-word;">ApiError: terminated</code><span> </span>with status 500:</p><span style="color: rgb(200, 200, 200); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; font-size: 13px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(0, 0, 0); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;"></span><pre style="overflow-x: auto; max-width: 100%; white-space: pre; padding: 8px; border-radius: 4px; margin: 8px 0px; box-sizing: border-box; color: rgb(200, 200, 200); font-size: 13px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(0, 0, 0); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"><code style="font-family: monospace; color: rgb(200, 200, 200); background-color: rgba(255, 255, 255, 0.1); padding: 2px 4px; border-radius: 3px; font-size: 0.9em; word-break: break-word;">ApiError: terminated
at FalStream.handleError (.../@fal-ai+client@1.7.2/libs/client/src/streaming.ts:303:11)
...
{
status: 500,
body: undefined,
requestId: ''
}
</code></pre><h3 style="color: rgb(200, 200, 200); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(0, 0, 0); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">Additional Testing</h3>
Test Case | Result
-- | --
fal.stream("fal-ai/flux/dev", {...}) | ✅ Works
fal.subscribe("fal-ai/flux/schnell", {...}) | ✅ Works
fal.stream("workflows/fal-ai/sdxl-sticker", {...}) | ✅ Works
fal.stream("workflows/execute", {...}) | ❌ 500 Error
Direct REST POST to https://fal.run/workflows/execute | ❌ 500 "Server got itself in trouble"
<h3 style="color: rgb(200, 200, 200); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(0, 0, 0); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">Notes</h3><ul style="padding-inline-start: 1.5em; color: rgb(200, 200, 200); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; font-size: 13px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(0, 0, 0); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"><li>The workflow definition follows the exact structure from<span> </span><a href="https://docs.fal.ai/model-apis/guides/custom-workflow-ui" target="_blank" rel="noopener noreferrer" style="color: rgb(0, 177, 255);">https://docs.fal.ai/model-apis/guides/custom-workflow-ui</a></li><li>Pre-built workflows (e.g.,<span> </span><code style="font-family: monospace; color: rgb(200, 200, 200); background-color: rgba(255, 255, 255, 0.1); padding: 2px 4px; border-radius: 3px; font-size: 0.9em; word-break: break-word;">workflows/fal-ai/sdxl-sticker</code>) work correctly with streaming</li><li>Individual model endpoints work correctly with both<span> </span><code style="font-family: monospace; color: rgb(200, 200, 200); background-color: rgba(255, 255, 255, 0.1); padding: 2px 4px; border-radius: 3px; font-size: 0.9em; word-break: break-word;">fal.stream()</code><span> </span>and<span> </span><code style="font-family: monospace; color: rgb(200, 200, 200); background-color: rgba(255, 255, 255, 0.1); padding: 2px 4px; border-radius: 3px; font-size: 0.9em; word-break: break-word;">fal.subscribe()</code></li><li>The issue appears to be specific to the custom<span> </span><code style="font-family: monospace; color: rgb(200, 200, 200); background-color: rgba(255, 255, 255, 0.1); padding: 2px 4px; border-radius: 3px; font-size: 0.9em; word-break: break-word;">workflows/execute</code><span> </span>endpoint</li></ul><!--EndFragment-->
</body>
</html>
关闭于 2025-12-02 1 条评论