Package Information
Available Nodes
Documentation
ChatAds n8n Wrapper
Custom n8n node + credential that calls the ChatAds API endpoint /v1/chatads/messages. Handles authentication via the x-api-key header and exposes all supported API fields so you can orchestrate ChatAds inside n8n workflows.
Layout
credentials/ChatAdsApi.credentials.ts– stores the base URL and API key reused by every node call.nodes/ChatAds/ChatAds.node.ts– singleAnalyze Prospectoperation that posts to/v1/chatads/messages.nodes/ChatAds/chatads.svg– lightweight icon so the node is recognizable inside the n8n editor.package.json,tsconfig.json,.gitignore– helper files so you can compile todist/withtsc(the artifacts n8n loads).
Using in n8n
- Install dependencies and build the TypeScript sources:
This producescd n8n npm install npm run builddist/credentials/ChatAdsApi.credentials.jsanddist/nodes/ChatAds/ChatAds.node.js. - Copy the compiled
distdirectory into your n8n custom nodes directory (for example~/.n8n/custom/) or publish the package to your internal npm registry and install it where your n8n instance can resolve it. - Restart n8n. The new ChatAds node will appear under the "Transform" group. Add it to a workflow, select the
ChatAds APIcredential, and supply either:- A simple
messageplus optional fields (IP, country, etc.), or - A raw JSON payload (only documented fields are accepted; unexpected keys are rejected to prevent tampering).
- A simple
- Optionally tune
Max Concurrent Requests(default 4) andRequest Timeout (seconds)for high-volume workflows. The node keeps item ordering consistent even when issuing requests in parallel. - When executed, the node sends a POST request to
{{baseUrl}}/v1/chatads/messages(configurable via theEndpoint Overrideparameter) with yourx-api-keyheader and returns the API response verbatim so downstream nodes can branch onerror(null for success) or any affiliate offers the backend generated.
The base URL must use HTTPS — the node rejects plaintext HTTP URLs so API keys are never transmitted insecurely.
Because the wrapper uses this.helpers.httpRequestWithAuthentication, it honors n8n's retry/backoff settings and the Continue On Fail toggle while layering per-node timeouts and error payloads for easier debugging.Extra Fields (JSON) is validated to prevent conflicts with reserved parameter keys, so untrusted workflows cannot silently override core fields.
Releasing/Patching
- Bump the version in
package.jsonwhenever you change behavior (validation rules, new fields, etc.). - Run
npm run buildto regeneratedist/artifacts—these compiled files are what n8n loads, so they must stay in sync with the TypeScript sources. - Copy/publish the updated
dist/directory to your custom nodes location or npm registry, then restart n8n. - If the backend
FunctionItemschema changes, update both the parameter list inChatAds.node.tsand theOPTIONAL_FIELDSset near the top of the file to keep validation in sync.
Consider keeping a short changelog (GitHub release notes or a CHANGELOG.md) so downstream workflows know when to reinstall the node.
Request Fields
The node accepts the following fields (via parameters or Extra Fields (JSON)):
| Field | Type | Description |
|---|---|---|
message |
string (required) | Message to analyze (max 10,000 chars) |
ip |
string | IPv4/IPv6 address for country detection (max 45 characters) |
country |
string | Country code (e.g., 'US'). If provided, skips IP-based country detection |
extraction_mode |
string | Extraction control: none or standard (default) |
resolution_mode |
string | Resolution control: none or standard (default) |
max_offers |
number | Max distinct keyterms with offers extracted (1-3, default 1) |
max_products_per_offer |
number | Max resolved products per offer carousel (1-3, default 1) |
metadata |
json object | Arbitrary JSON metadata passed through to the response (max 10KB) |