FlowiseAI/Flowise · error · Error
Error submitting tool outputs. Thread ID: ${threadId}. Run I
Error message
Error submitting tool outputs. Thread ID: ${threadId}. Run ID: ${runThreadId} What it means
After tools execute, their outputs are submitted back to the OpenAI run via handleToolSubmission. If that submission call fails (network, OpenAI 4xx/5xx, run already expired/cancelled), the code cancels the run, reports onLLMError/onChainError, and throws this message. The original submission error is logged but not in the thrown message.
Source
Thrown at packages/components/nodes/agents/OpenAIAssistant/OpenAIAssistant.ts:622
chatId,
options,
input,
usedTools,
text,
isStreamingStarted
})
text = result.text
isStreamingStarted = result.isStreamingStarted
} catch (error) {
console.error('Error submitting tool outputs:', error)
await openai.beta.threads.runs.cancel(runThreadId, { thread_id: threadId })
const errMsg = `Error submitting tool outputs. Thread ID: ${threadId}. Run ID: ${runThreadId}`
await analyticHandlers.onLLMError(llmIds, errMsg)
await analyticHandlers.onChainError(parentIds, errMsg, true)
throw new Error(errMsg)
}
}
}
}
// List messages
const messages = await openai.beta.threads.messages.list(threadId)
const messageData = messages.data ?? []
const assistantMessages = messageData.filter((msg) => msg.role === 'assistant')
if (!assistantMessages.length) return ''
// Remove images from the logging text
let llmOutput = text.replace(imageRegex, '')
llmOutput = llmOutput.replace('<br/>', '')
await analyticHandlers.onLLMEnd(llmIds, llmOutput)
await analyticHandlers.onChainEnd(parentIds, messageData, true)
return {View on GitHub (pinned to abe4a8601a)
Solutions
- Read server logs for `Error submitting tool outputs:` which prints the underlying error.
- Make tools faster so submission happens before the run expires (~10 min limit).
- For 429s, reduce concurrency or add backoff; for 5xx, retry the run.
- Ensure the thread/run is not being cancelled elsewhere concurrently.
- Patch the message to include the cause for easier triage.
Example fix
// before
const errMsg = `Error submitting tool outputs. Thread ID: ${threadId}. Run ID: ${runThreadId}`
// after
const errMsg = `Error submitting tool outputs. Thread ID: ${threadId}. Run ID: ${runThreadId}. Cause: ${error instanceof Error ? error.message : String(error)}` Defensive patterns
Strategy: retry
Try / catch
for (let attempt = 0; attempt < 3; attempt++) {
try {
return await assistantNode.run(nodeData, input, options)
} catch (e) {
if ((e as Error).message.startsWith('Error submitting tool outputs.') && attempt < 2) {
await new Promise((r) => setTimeout(r, 1000 * 2 ** attempt)); continue
}
throw e
}
} Prevention
- Keep tool execution well under the OpenAI run lifetime (~10 min).
- Reduce concurrency to avoid 429s on submission.
- Avoid concurrent cancellation of the same thread/run.
- Use streaming submission to surface failures earlier.
When it happens
Trigger: openai.beta.threads.runs.submitToolOutputs (or the stream) returns an error; the runThreadId is no longer active (expired, already cancelled); rate limit (429); network failure mid-submission.
Common situations: Tool took too long so the run expired before submission; OpenAI rate limit; transient network blip; concurrent modification/cancellation of the thread.
Related errors
- HTTP error! status: ${response.status}
- Assistant ${selectedAssistantId} not found
- OpenAI ApiKey not found
- Error executing tool. Tool: ${tool.name}. Thread ID: ${threa
- Error processing thread: ${state}, Thread ID: ${threadId}
AI-assisted analysis of FlowiseAI/Flowise@abe4a8601a (2026-08-12).
Data as JSON: /api/errors/740f8c333b864969.
Report an issue: GitHub.