FlowiseAI/Flowise · error · Error
Cloudflare API Token is missing in credential.
Error message
Cloudflare API Token is missing in credential.
What it means
Thrown by ChatCloudflareWorkersAI.init() (line 64) when getCredentialParam('cloudflareApiToken', credentialData, nodeData) returns a falsy value. Flowise stores per-node secrets inside a credential record resolved via getCredentialData; this guard ensures the Cloudflare Workers AI API token exists before the underlying client is constructed. It runs only after the earlier 'cloudflareAccountId' check passes.
Source
Thrown at packages/components/nodes/chatmodels/ChatCloudflareWorkersAI/ChatCloudflareWorkersAI.ts:64
optional: true,
additionalParams: true
}
]
}
async init(nodeData: INodeData, _: string, options: ICommonObject): Promise<ChatCloudflareWorkersAI> {
const model = nodeData.inputs?.model as string
const baseUrl = nodeData.inputs?.baseUrl as string
const credentialData = await getCredentialData(nodeData.credential ?? '', options)
const cloudflareAccountId = getCredentialParam('cloudflareAccountId', credentialData, nodeData)
if (!cloudflareAccountId) {
throw new Error('Cloudflare Account ID is missing in credential.')
}
const cloudflareApiToken = getCredentialParam('cloudflareApiToken', credentialData, nodeData)
if (!cloudflareApiToken) {
throw new Error('Cloudflare API Token is missing in credential.')
}
const obj: CloudflareWorkersAIInput = {
cloudflareAccountId,
cloudflareApiToken,
model
}
if (baseUrl) {
await checkDenyList(baseUrl)
obj.baseUrl = baseUrl
}
const chatModel = new ChatCloudflareWorkersAI(obj)
return chatModel
}
}
View on GitHub (pinned to abe4a8601a)
Solutions
- In the Flowise canvas, open the ChatCloudflareWorkersAI node and bind (or re-bind) a Cloudflare credential whose cloudflareApiToken field is populated.
- Re-open the credential component, paste a valid Cloudflare API token from Cloudflare dashboard > My Profile > API Tokens, and save.
- Confirm cloudflareAccountId is also set on the same credential, since the preceding guard throws if it is missing.
Example fix
// before: credential saved with empty token // cloudflareApiToken: "" // after: credential saved with a real token // cloudflareApiToken: "<token-from-cloudflare-dashboard>"
Defensive patterns
Strategy: validation
Validate before calling
// Before invoking the node, assert the credential has the token.
import { getCredentialData, getCredentialParam } from '../../utils'
async function assertCloudflareCred(nodeData, options) {
const cred = await getCredentialData(nodeData.credential ?? '', options)
const token = getCredentialParam('cloudflareApiToken', cred, nodeData)
const accountId = getCredentialParam('cloudflareAccountId', cred, nodeData)
if (!accountId) throw new Error('cloudflareAccountId missing')
if (!token) throw new Error('cloudflareApiToken missing')
return { accountId, token }
} Type guard
type CloudflareCred = { cloudflareAccountId: string; cloudflareApiToken: string }
function isCloudflareCred(c: unknown): c is CloudflareCred {
return typeof c === 'object' && c !== null
&& typeof (c as any).cloudflareAccountId === 'string' && (c as any).cloudflareAccountId !== ''
&& typeof (c as any).cloudflareApiToken === 'string' && (c as any).cloudflareApiToken !== ''
} Try / catch
try {
await chatNode.init(nodeData, '', options)
} catch (e) {
if (e instanceof Error && /Cloudflare API Token is missing/.test(e.message)) {
// surface a credential-edit prompt to the user
}
throw e
} Prevention
- Bind credentials at chatflow build time and run a test chat before publishing.
- Use a single shared Cloudflare credential component across nodes so the token lives in one place.
- Treat empty-string secrets as missing when saving credential components.
When it happens
Trigger: The node's init() runs during chat invocation; getCredentialData resolves a credential object, but the cloudflareApiToken field within that object is undefined, null, or an empty string.
Common situations: A Flowise Cloudflare credential component was created/saved with an empty token field, the wrong credential type is bound to the node, or the token was revoked/deleted in the Cloudflare dashboard and the credential was never re-saved.
Related errors
- CometAPI API Key is missing or empty. Please provide a valid
- Pipedream Project ID is required in credentials
- Pipedream Client ID and Client Secret are required in creden
- Model is required
- Model is required
AI-assisted analysis of FlowiseAI/Flowise@abe4a8601a (2026-08-12).
Data as JSON: /api/errors/82ca0ef132e4e9e8.
Report an issue: GitHub.