{"record":{"id":"565550ed9954715b","repo":"FlowiseAI/Flowise","slug":"sns-topic-arn-is-required","errorCode":null,"errorMessage":"SNS Topic ARN is required","messagePattern":"SNS Topic ARN is required","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/components/nodes/tools/AWSSNS/AWSSNS.ts","lineNumber":134,"sourceCode":"                console.error('Error loading SNS topics:', error)\n                return [\n                    {\n                        label: 'AWS Credentials Required',\n                        name: 'placeholder',\n                        description: 'Enter AWS Access Key ID and Secret Access Key'\n                    }\n                ]\n            }\n        }\n    }\n\n    async init(nodeData: INodeData, _: string, options: ICommonObject): Promise<any> {\n        const credentials = await getAWSCredentials(nodeData, options)\n        const region = (nodeData.inputs?.region as string) || DEFAULT_AWS_REGION\n        const topicArn = nodeData.inputs?.topicArn as string\n\n        if (!topicArn) {\n            throw new Error('SNS Topic ARN is required')\n        }\n\n        const snsClient = new SNSClient({\n            region: region,\n            credentials: credentials\n        })\n\n        return new AWSSNSTool(snsClient, topicArn)\n    }\n}\n\nmodule.exports = { nodeClass: AWSSNS_Tools }\n","sourceCodeStart":116,"sourceCodeEnd":147,"githubUrl":"https://github.com/FlowiseAI/Flowise/blob/abe4a8601a058047b350c260676826e21dd14101/packages/components/nodes/tools/AWSSNS/AWSSNS.ts#L116-L147","documentation":"Thrown in AWSSNS_Tools.init when topicArn is falsy. The SNSClient is never constructed because topicArn is a required constructor argument for AWSSNSTool (every publish needs a target ARN). There is no default or fallback — the tool cannot operate without an explicit topic.","triggerScenarios":"The node's topicArn input was never bound; the upstream node that should supply the ARN returned undefined; the flow was duplicated and the ARN field was cleared.","commonSituations":"Topic created in a different account/region and the ARN not yet copied in; using a topic name instead of the full ARN (arn:aws:sns:<region>:<accountId>:<topicName>); environment-specific flows where the prod ARN was templated but never filled.","solutions":["Set inputs.topicArn to the full ARN, e.g. arn:aws:sns:us-east-1:123456789012:my-topic.","If the ARN comes from another node, confirm that node's output is connected and non-empty at runtime.","Store the ARN in a credential or environment variable and reference it rather than hard-coding per environment."],"exampleFix":"// before\nconst topicArn = nodeData.inputs?.topicArn as string // undefined\n// after\nconst topicArn = nodeData.inputs?.topicArn as string\nif (!topicArn || !topicArn.startsWith('arn:aws:sns:')) {\n  throw new Error(`SNS Topic ARN is required and must look like arn:aws:sns:<region>:<acct>:<name>`)\n}","handlingStrategy":"validation","validationCode":"const SNS_ARN_RE = /^arn:aws:sns:[a-z0-9-]+:\\d{12}:.+$/\nfunction assertTopicArn(arn: string | undefined): asserts arn is string {\n  if (!arn || !SNS_ARN_RE.test(arn)) {\n    throw new Error(`SNS Topic ARN is required and must match arn:aws:sns:<region>:<acct>:<name>`)\n  }\n}","typeGuard":"function isSnsTopicArn(arn: unknown): arn is string {\n  return typeof arn === 'string' && /^arn:aws:sns:[a-z0-9-]+:\\d{12}:.+$/.test(arn)\n}","tryCatchPattern":null,"preventionTips":["Copy the full ARN from the AWS SNS console, not just the topic name.","Store ARNs per environment in a config map rather than hard-coding.","Bind the topicArn input to an upstream node output rather than a literal where possible."],"tags":["aws","sns","config","validation"],"backgroundTag":null,"analyzedSha":"abe4a8601a058047b350c260676826e21dd14101","analyzedAt":"2026-08-12T16:04:40.823Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}