FlowiseAI/Flowise · error · Error

Unknown extract status: ${statusData.status}

Error message

Unknown extract status: ${statusData.status}

What it means

Thrown by monitorExtractStatus when the extract-status response carries a `status` outside the handled set {'completed','processing','failed'}. Any new state (e.g. 'pending','queued','cancelled') trips the default branch.

Source

Thrown at packages/components/nodes/documentloaders/FireCrawl/FireCrawl.ts:523

    private async monitorExtractStatus(jobId: string, headers: AxiosRequestHeaders, checkInterval: number): Promise<ExtractStatusResponse> {
        let isJobCompleted = false
        while (!isJobCompleted) {
            const statusResponse: AxiosResponse = await this.getRequest(this.apiUrl + `/v1/extract/${jobId}`, headers)
            if (statusResponse.status === 200) {
                const statusData = statusResponse.data as ExtractStatusResponse
                switch (statusData.status) {
                    case 'completed':
                        isJobCompleted = true
                        return statusData
                    case 'processing':
                    case 'failed':
                        if (statusData.status === 'failed') {
                            throw new Error('Extract job failed')
                        }
                        await new Promise((resolve) => setTimeout(resolve, Math.max(checkInterval, 2) * 1000))
                        break
                    default:
                        throw new Error(`Unknown extract status: ${statusData.status}`)
                }
            } else {
                this.handleError(statusResponse, 'check extract status')
            }
        }
        throw new Error('Failed to monitor extract status')
    }

    private handleError(response: AxiosResponse, action: string): void {
        if ([402, 408, 409, 500].includes(response.status)) {
            const errorMessage: string = response.data.error || 'Unknown error occurred'
            throw new Error(`Failed to ${action}. Status code: ${response.status}. Error: ${errorMessage}`)
        } else {
            throw new Error(`Unexpected error occurred while trying to ${action}. Status code: ${response.status}`)
        }
    }
}

View on GitHub (pinned to abe4a8601a)

Solutions

  1. Add 'pending' to the in-progress branch so early polls don't crash: `case 'pending': case 'processing':`.
  2. Handle 'cancelled' explicitly (re-throw or restart).
  3. Insert an initial small delay before the first poll if you control the caller.

Example fix

// before
case 'processing': case 'failed': ...
default: throw new Error(`Unknown extract status: ${statusData.status}`)

// after
case 'pending': case 'processing':
  await sleep(Math.max(checkInterval, 2) * 1000); break
case 'failed': case 'cancelled':
  throw new Error(statusData.status)
default: throw new Error(`Unknown extract status: ${statusData.status}`)
Defensive patterns

Strategy: type-guard

Validate before calling

const safe = new Set(['completed','processing','failed'])
if (!safe.has(statusData.status)) console.warn('unhandled extract status:', statusData.status)

Type guard

function isKnownExtractStatus(s: string): boolean {
  return ['completed','pending','processing','failed','cancelled'].includes(s)
}

Try / catch

try { return await app.extract(req) }
catch (e) {
  if (/Unknown extract status:/.test((e as Error).message)) { await sleep(2000); return app.extract(req) }
  throw e
}

Prevention

When it happens

Trigger: ExtractStatusResponse interface declares status as 'completed'|'pending'|'processing'|'failed'|'cancelled', but the switch only handles completed/processing/failed — so 'pending' and 'cancelled' both fall through to this throw.

Common situations: Job is still pending (not yet processing) — polling started too early; job cancelled from FireCrawl dashboard; new FireCrawl API status added.

Related errors


AI-assisted analysis of FlowiseAI/Flowise@abe4a8601a (2026-08-12). Data as JSON: /api/errors/47fd827b97ca77ca. Report an issue: GitHub.