{"record":{"id":"35b1cf26daa68038","repo":"FlowiseAI/Flowise","slug":"api-key-required","errorCode":null,"errorMessage":"API Key Required","messagePattern":"API Key Required","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/components/nodes/tools/Composio/Composio.ts","lineNumber":240,"sourceCode":"                name: c.id,\n                description: `Created: ${new Date(c.createdAt).toLocaleDateString()}`\n            }))\n        }\n    }\n\n    async init(nodeData: INodeData, _: string, options: ICommonObject): Promise<any> {\n        if (!nodeData.inputs) nodeData.inputs = {}\n\n        const credentialData = await getCredentialData(nodeData.credential ?? '', options)\n        const composioApiKey = getCredentialParam('composioApi', credentialData, nodeData)\n\n        if (!composioApiKey) {\n            nodeData.inputs = {\n                appName: undefined,\n                connectedAccountId: '',\n                actions: []\n            }\n            throw new Error('API Key Required')\n        }\n\n        const _actions = nodeData.inputs?.actions\n        let actions = []\n        if (_actions) {\n            try {\n                actions = typeof _actions === 'string' ? JSON.parse(_actions) : _actions\n            } catch (error) {\n                console.error('Error parsing actions:', error)\n            }\n        }\n\n        const toolset = new LangchainToolSet({ apiKey: composioApiKey })\n        const appName = nodeData.inputs?.appName as string\n\n        if (!appName) {\n            throw new Error('App name is required. Please select an app.')\n        }","sourceCodeStart":222,"sourceCodeEnd":258,"githubUrl":"https://github.com/FlowiseAI/Flowise/blob/abe4a8601a058047b350c260676826e21dd14101/packages/components/nodes/tools/Composio/Composio.ts#L222-L258","documentation":"Thrown in Composio_Tools.init when composioApiKey is falsy after reading the credential. Before throwing, the code clears appName, connectedAccountId and actions in nodeData.inputs so the UI does not show stale tool metadata. Composio's LangchainToolSet needs the API key to even list apps/actions, so an empty key is a hard stop.","triggerScenarios":"No credential attached to the node; credential attached but the 'composioApi' field is empty; credential lookup failed (wrong id, deleted credential).","commonSituations":"First-time setup before creating a Composio API key; credential was rotated and the stored value removed; flow imported without its credential.","solutions":["Create a Composio API key at app.composio.dev and add it to a credential of type Composio with field name 'composioApi'.","Attach that credential to the node.","Confirm nodeData.credential references the correct credential id and that getCredentialData resolves it."],"exampleFix":"// before\nif (!composioApiKey) {\n  nodeData.inputs = { appName: undefined, connectedAccountId: '', actions: [] }\n  throw new Error('API Key Required')\n}\n// after: name the missing field explicitly\nif (!composioApiKey) {\n  nodeData.inputs = { appName: undefined, connectedAccountId: '', actions: [] }\n  throw new Error('Composio API Key Required: add a Composio credential with field \"composioApi\" and attach it to this node.')\n}","handlingStrategy":"validation","validationCode":"function assertComposioKey(key: string | undefined): asserts key is string {\n  if (!key || !key.trim()) {\n    throw new Error('Composio API Key Required: add a Composio credential with field \"composioApi\" and attach it.')\n  }\n}","typeGuard":"function hasComposioKey(cred: unknown): cred is { composioApi: string } {\n  return typeof cred === 'object' && cred !== null && typeof (cred as any).composioApi === 'string' && (cred as any).composioApi.length > 0\n}","tryCatchPattern":null,"preventionTips":["Create the Composio API key at app.composio.dev before configuring the node.","Store it in a dedicated credential of type Composio (field name 'composioApi').","Always attach the credential to the node and verify the credential id resolves."],"tags":["composio","credentials","config","api-key","auth"],"backgroundTag":null,"analyzedSha":"abe4a8601a058047b350c260676826e21dd14101","analyzedAt":"2026-08-12T16:04:40.823Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}