FlowiseAI/Flowise · error · Error

SNS Topic ARN is required

Error message

SNS Topic ARN is required

What it means

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.

Source

Thrown at packages/components/nodes/tools/AWSSNS/AWSSNS.ts:134

                console.error('Error loading SNS topics:', error)
                return [
                    {
                        label: 'AWS Credentials Required',
                        name: 'placeholder',
                        description: 'Enter AWS Access Key ID and Secret Access Key'
                    }
                ]
            }
        }
    }

    async init(nodeData: INodeData, _: string, options: ICommonObject): Promise<any> {
        const credentials = await getAWSCredentials(nodeData, options)
        const region = (nodeData.inputs?.region as string) || DEFAULT_AWS_REGION
        const topicArn = nodeData.inputs?.topicArn as string

        if (!topicArn) {
            throw new Error('SNS Topic ARN is required')
        }

        const snsClient = new SNSClient({
            region: region,
            credentials: credentials
        })

        return new AWSSNSTool(snsClient, topicArn)
    }
}

module.exports = { nodeClass: AWSSNS_Tools }

View on GitHub (pinned to abe4a8601a)

Solutions

  1. Set inputs.topicArn to the full ARN, e.g. arn:aws:sns:us-east-1:123456789012:my-topic.
  2. If the ARN comes from another node, confirm that node's output is connected and non-empty at runtime.
  3. Store the ARN in a credential or environment variable and reference it rather than hard-coding per environment.

Example fix

// before
const topicArn = nodeData.inputs?.topicArn as string // undefined
// after
const topicArn = nodeData.inputs?.topicArn as string
if (!topicArn || !topicArn.startsWith('arn:aws:sns:')) {
  throw new Error(`SNS Topic ARN is required and must look like arn:aws:sns:<region>:<acct>:<name>`)
}
Defensive patterns

Strategy: validation

Validate before calling

const SNS_ARN_RE = /^arn:aws:sns:[a-z0-9-]+:\d{12}:.+$/
function assertTopicArn(arn: string | undefined): asserts arn is string {
  if (!arn || !SNS_ARN_RE.test(arn)) {
    throw new Error(`SNS Topic ARN is required and must match arn:aws:sns:<region>:<acct>:<name>`)
  }
}

Type guard

function isSnsTopicArn(arn: unknown): arn is string {
  return typeof arn === 'string' && /^arn:aws:sns:[a-z0-9-]+:\d{12}:.+$/.test(arn)
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


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