FlowiseAI/Flowise · critical · Error

Firecrawl API key not set. You can set it as FIRECRAWL_API_K

Error message

Firecrawl API key not set. You can set it as FIRECRAWL_API_KEY in your .env file, or pass it to Firecrawl.

What it means

Thrown by the FireCrawlLoader constructor when `apiKey` is falsy. The loader refuses to instantiate without credentials because every FireCrawl API call requires a Bearer token. The message directs users to FIRECRAWL_API_KEY or the constructor param.

Source

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

    apiKey?: string
    apiUrl?: string
    mode?: 'crawl' | 'scrape' | 'extract' | 'search'
    params?: Record<string, unknown>
}

export class FireCrawlLoader extends BaseDocumentLoader {
    private apiKey: string
    private apiUrl: string
    private url?: string
    private query?: string
    private mode: 'crawl' | 'scrape' | 'extract' | 'search'
    private params?: Record<string, unknown>

    constructor(loaderParams: FirecrawlLoaderParameters) {
        super()
        const { apiKey, apiUrl, url, query, mode = 'crawl', params } = loaderParams
        if (!apiKey) {
            throw new Error('Firecrawl API key not set. You can set it as FIRECRAWL_API_KEY in your .env file, or pass it to Firecrawl.')
        }

        this.apiKey = apiKey
        this.url = url
        this.query = query
        this.mode = mode
        this.params = params
        this.apiUrl = apiUrl || 'https://api.firecrawl.dev'
    }

    public async load(): Promise<DocumentInterface[]> {
        const app = new FirecrawlApp({ apiKey: this.apiKey, apiUrl: this.apiUrl })
        let firecrawlDocs: FirecrawlDocument[]

        if (this.mode === 'search') {
            if (!this.query) {
                throw new Error('Firecrawl: Query is required for search mode')
            }

View on GitHub (pinned to abe4a8601a)

Solutions

  1. In Flowise, attach the 'FireCrawl API' credential to the node and store the key.
  2. Or set FIRECRAWL_API_KEY=<key> in the server .env and restart.
  3. Verify getCredentialParam('credential', options, additionalConfig) returns a value before constructing the loader.
  4. Generate a new key at firecrawl.dev if the old one is lost.

Example fix

// before
const loader = new FireCrawlLoader({ apiKey: process.env.FIRECRAWL_API_KEY, url, mode: 'crawl' })

// after
const apiKey = getCredentialParam('fireCrawlApi', credentials, additionalConfig) ?? process.env.FIRECRAWL_API_KEY
if (!apiKey) throw new Error('Attach a FireCrawl credential or set FIRECRAWL_API_KEY before running this node')
const loader = new FireCrawlLoader({ apiKey, url, mode: 'crawl' })
Defensive patterns

Strategy: validation

Validate before calling

const apiKey = (loaderParams.apiKey ?? getCredentialParam('fireCrawlApi', creds, cfg) ?? process.env.FIRECRAWL_API_KEY || '').trim()
if (!apiKey) throw new Error('FireCrawl API key missing')
const loader = new FireCrawlLoader({ ...loaderParams, apiKey })

Type guard

function hasApiKey(p: FirecrawlLoaderParameters): p is FirecrawlLoaderParameters & { apiKey: string } {
  return typeof p.apiKey === 'string' && p.apiKey.trim().length > 0
}

Try / catch

try { return new FireCrawlLoader(params) }
catch (e) {
  if (/API key not set/.test((e as Error).message)) throw new Error('Attach a FireCrawl credential in Flowise')
  throw e
}

Prevention

When it happens

Trigger: new FireCrawlLoader({ apiKey: undefined | null | '' }) — typically because getCredentialParam returned empty (credential not attached in Flowise) or FIRECRAWL_API_KEY is unset in .env.

Common situations: Flowise node deployed without the FireCrawl credential attached; .env missing FIRECRAWL_API_KEY; credential name typo (must be 'fireCrawlApi'); migrating from env var to credential store and forgetting to populate it.

Related errors


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