FlowiseAI/Flowise · critical · Error
Failed to load OpenAPI spec
Error message
Failed to load OpenAPI spec
What it means
Thrown by OpenAPIToolkit.init when loadOpenApiSpec returns a falsy value, meaning the spec could not be resolved from either a uploaded file (openApiFile) or a remote link (openApiLink) given the chosen inputType. The toolkit needs a parsed OpenAPI document to dereference with $RefParser and to derive tools, so a null/empty spec aborts initialization.
Source
Thrown at packages/components/nodes/tools/OpenAPIToolkit/OpenAPIToolkit.ts:144
const inputType = nodeData.inputs?.inputType as string
const openApiFile = nodeData.inputs?.openApiFile as string
const openApiLink = nodeData.inputs?.openApiLink as string
const selectedServer = nodeData.inputs?.selectedServer as string
const customCode = nodeData.inputs?.customCode as string
const _headers = nodeData.inputs?.headers as string
const removeNulls = nodeData.inputs?.removeNulls as boolean
const headers = typeof _headers === 'object' ? _headers : _headers ? JSON.parse(_headers) : {}
const specData = await this.loadOpenApiSpec(
{
inputType,
openApiFile,
openApiLink
},
options
)
if (!specData) throw new Error('Failed to load OpenAPI spec')
const _data: any = await $RefParser.dereference(specData)
// Use selected server or fallback to first server
let baseUrl: string
if (selectedServer && selectedServer !== 'error') {
baseUrl = selectedServer
} else {
baseUrl = _data.servers?.[0]?.url
}
if (!baseUrl) throw new Error('OpenAPI spec does not contain a server URL')
const appDataSource = options.appDataSource as DataSource
const databaseEntities = options.databaseEntities as IDatabaseEntity
const variables = await getVars(appDataSource, databaseEntities, nodeData, options)
const flow = { chatflowId: options.chatflowid }
View on GitHub (pinned to abe4a8601a)
Solutions
- Confirm inputType matches the field you populated: 'file' with openApiFile, 'link' with openApiLink.
- If using a link, open it in a browser to confirm it is reachable and returns valid OpenAPI YAML/JSON.
- If using a file, re-upload the spec and confirm it persisted.
- Check that the link is not blocked by network policy, proxy, or auth; mirror the spec locally if needed.
- Validate the spec with a linter (e.g. Swagger Editor) to ensure it is well-formed before this node runs.
Example fix
// before
nodeData.inputs = { inputType: 'link', openApiLink: '' }
// after
nodeData.inputs = { inputType: 'link', openApiLink: 'https://petstore.swagger.io/v2/swagger.json' } Defensive patterns
Strategy: validation
Validate before calling
async function specIsLoadable(inputType: string, openApiFile: string, openApiLink: string): Promise<boolean> {
if (inputType === 'file') return Boolean(openApiFile)
if (inputType === 'link') {
if (!openApiLink) return false
try {
const res = await fetch(openApiLink)
return res.ok
} catch { return false }
}
return false
} Type guard
function hasSpecInput(i: unknown): i is { inputType: string; openApiFile?: string; openApiLink?: string } {
return typeof i === 'object' && i !== null && typeof (i as any).inputType === 'string'
&& (((i as any).inputType === 'file' && (i as any).openApiFile) || ((i as any).inputType === 'link' && (i as any).openApiLink))
} Try / catch
try {
const tools = await toolkit.init(nodeData, '', options)
} catch (e) {
if (e instanceof Error && e.message === 'Failed to load OpenAPI spec') {
// verify inputType matches the populated field, re-check link/file
} else throw e
} Prevention
- Keep inputType consistent with the populated field (file vs link).
- Lint the spec with Swagger Editor before wiring it.
- For remote links, mirror the spec locally to avoid network/egress issues.
When it happens
Trigger: inputType set to 'link' but openApiLink is empty or returns 404; inputType set to 'file' but openApiFile is empty or the file was deleted; network/proxy blocking the remote fetch; the uploaded spec file failed to persist in storage; inputType mismatched the field that was actually filled.
Common situations: User selected the wrong inputType (e.g. 'link' while only uploading a file); the OpenAPI URL is behind auth or a corporate proxy; the spec file upload silently failed; a typo in the URL; the spec is YAML that failed JSON parsing before this check.
Related errors
- OpenAPI spec does not contain a server URL
- JSON Path is required
- No Jira host provided
- Model is required
- Invalid Flow State
AI-assisted analysis of FlowiseAI/Flowise@abe4a8601a (2026-08-12).
Data as JSON: /api/errors/48cebe9b5ddae04f.
Report an issue: GitHub.