npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

n8n-nodes-attentive-api

v0.2.0

Published

An n8n community node for the Attentive Mobile API — subscriptions, custom events, attributes, ecommerce events, identity, and webhooks with multi-account support

Downloads

274

Readme

n8n-nodes-attentive-api

An n8n community node for the Attentive Mobile API. Handles SMS/email subscriptions, custom events, subscriber attributes, ecommerce tracking, and more — without the usual headaches of wrangling the Attentive API directly.

About Attentive

Attentive is an SMS and email marketing platform focused on personalized messaging for ecommerce brands. Their API lets you manage subscribers, fire events that trigger automated journeys, and sync customer data — but it has a few sharp edges that make working with raw HTTP requests tedious (more on that below).

About n8n

n8n is a fair-code licensed workflow automation platform. Think Zapier, but self-hostable and way more flexible.

Why This Node?

If you've tried using Attentive's API from n8n's HTTP Request node, you've probably run into a few of these:

  • Subscribers have to exist first before you can update their attributes or fire events — otherwise the API silently fails or returns a 400.
  • Custom event properties have to be flat — no nested objects or arrays. If you send {"items": [...]} you get a cryptic error.
  • The attributes endpoint requires exactly one of email or phone, not both. Send both? 400.
  • Phone numbers must be E.164 (+15551234567). Pass (555) 123-4567 and nothing happens.
  • Each brand/account has its own API key, so multi-brand setups mean duplicating every API call node.

This node handles all of that for you. Phone formatting, property flattening, identifier validation — it's all built in. And if you're running multiple Attentive accounts (say, different brands or regions), you can store all the API keys in a single credential and switch between them with an expression.

Table of Contents

Installation

Install via the n8n community nodes UI, or with npm:

npm install n8n-nodes-attentive-api

Credentials

  1. In n8n, go to Credentials and create a new Attentive API credential
  2. Paste your Bearer token from your Attentive custom app into Default API Key
  3. Hit Test — it calls GET /v2/me to verify the token works

That's it for single-account usage. For multi-account, see below.

Operations

Subscriber

  • Subscribe — Opt a user into SMS/email. Supports both MARKETING and TRANSACTIONAL subscription types. You can provide a signUpSourceId (Attentive's sign-up unit ID) or let the node use subscriptionType + locale instead.
  • Get Eligibility — Check whether a user can be subscribed and see what they're currently subscribed to.
  • Unsubscribe — Remove a user from a specific subscription, or all of them. Heads up: the Attentive API treats an empty subscriptions array as "unsubscribe from everything" — the node makes you explicitly choose "All" so you don't do this by accident.

Custom Event

  • Send — Fire a named event that can trigger Attentive journeys. Properties are automatically flattened to primitives (you can disable this if your data is already flat). The event type is case-sensitive — "Order Success" and "order success" are two different events in Attentive.

Custom Attribute

  • Set — Create or update attributes on a subscriber profile. Values have to be scalar (string, number, boolean) — Attentive doesn't support array values here.
  • Get — Pull back the custom attributes for a subscriber.

eCommerce Event

  • Product View — Log a product view
  • Add to Cart — Log an add-to-cart
  • Purchase — Log a purchase (this is the one you want for order confirmations and post-purchase flows)

Identity

  • Associate — Link a phone number, email, and/or your own customer ID together for identity resolution. Useful when a customer uses different identifiers across touchpoints.

Webhook

  • List / Create / Update / Delete — Full CRUD for Attentive webhooks. Subscribe to events like sms.subscribed, email.opened, custom_attribute.set, etc.

Account

  • Get Info — Returns your account name, company, and domain. Handy for verifying which account you're talking to, especially in multi-account setups.

Trigger

  • Attentive Trigger — A dedicated trigger node that auto-registers a webhook in Attentive for a specific event type (for example, sms.subscribed, email.opened, or custom_attribute.set) and starts your workflow whenever that event fires. The node handles webhook create/delete on workflow activate/deactivate so you don’t have to manage URLs in the Attentive UI.

User Properties (V2)

  • Upsert User — Uses the /v2/user/attributes endpoint to create or update a user and their attributes, identifiers, and subscriptions in one call. This is the most future-proof way to sync profile data with Attentive and matches their v2 API spec.

Multi-Account Setup

If you manage multiple Attentive accounts (different brands, regions, etc.), you don't need a separate credential for each one.

  1. In your Attentive API credential, set the Default API Key to your primary account
  2. Add an Account Map — a JSON object mapping short names to API keys:
{
  "us": "your-us-api-key",
  "borne": "your-borne-api-key",
  "uk": "your-uk-api-key",
  "eu": "your-eu-api-key"
}
  1. In any Attentive node, set the Account field to the key name. It supports expressions, so you can drive it from your input data:
={{ $json.region }}

If the account name doesn't match anything in the map, it falls back to the default key. There's also an API Key Override field on every operation if you need to inject a key completely dynamically.

Things Worth Knowing

These are the Attentive API behaviors that tripped us up during development. The node handles most of them, but it's good to know what's happening under the hood.

Phone numbers get auto-formatted. Pass 5551234567, (555) 123-4567, or 1-555-123-4567 — the node normalizes everything to E.164 (+15551234567) before sending.

Custom event properties are flattened automatically. If you pass {"items": [1, 2, 3]}, the node will JSON.stringify the array value so Attentive doesn't reject it. You can disable this with the "Flatten Properties" toggle if you're already handling it.

The attributes endpoint is picky about identifiers. Send both email and phone? 400 error. Send neither? Also 400. The node validates this before making the request and gives you a clear error.

Subscribe is asynchronous. You get a 202 Accepted, not a 200 OK. The subscriber isn't instantly available — there's a brief delay before you can update their attributes or fire events. That's why the original n8n flow used merge/wait nodes as a sync gate.

Re-subscribing someone who's already on TEXT sends them an "already subscribed" SMS. This is Attentive's behavior, not something the node can prevent. Be mindful when using Subscribe on users who might already be opted in.

Events older than 12 hours won't trigger Journeys. If you're backfilling historical events, they'll be recorded but won't kick off any automations. The occurredAt field description warns about this.

Rate limits vary by endpoint. Subscribe and Identity are limited to 10 req/sec. Unsubscribe is 5 req/sec. Everything else is 150 req/sec. The node logs a warning when the x-ratelimit-remaining header drops below 10.

Event type names are your segmentation keys. Whatever you put in the type field (e.g. "Order Success - mishimoto.com") is what shows up in Attentive's journey builder. Change the string and you break existing journeys.

Compatibility

  • n8n: 2.2.0+
  • Node.js: 18.17.0+

Docker Setup

FROM n8nio/n8n:latest
RUN npm install -g n8n-nodes-attentive-api

Then rebuild your container. Nodes installed with -g won't show in the "Community Nodes" settings page but will appear when you search for "Attentive" in the node picker.

If you want to pin a version:

RUN npm install -g [email protected]

Development

git clone https://github.com/Bwilliamson55/n8n-nodes-attentive.git
cd n8n-nodes-attentive
npm install
npm run build
npm link

Then in your n8n installation directory:

npm link n8n-nodes-attentive-api

Restart n8n and the node should show up. Use npm run dev for watch mode so you don't have to rebuild after every change (you'll still need to restart n8n to pick up changes).

Publishing

npm run build
npm run lint
npm pack --dry-run   # check what goes in the package
npm publish

Only the dist/ directory gets published, per the files array in package.json.

Contributing

Issues and PRs welcome. For anything big, open an issue first so we can talk through the approach.

License

MIT