SparkBot icon

SparkBot

Interact with SparkBot WhatsApp API

Actions148

Overview

This node enables forwarding a WhatsApp message from one chat to another using the SparkBot WhatsApp API. It is useful in scenarios where you want to programmatically share or redirect messages between different recipients, such as forwarding customer queries to specialized support groups, sharing important announcements across channels, or automating message distribution workflows.

For example, a customer support automation could forward a customer's question received in a private chat to a group of agents for collaborative handling. Another use case is forwarding promotional messages from a source channel to multiple target channels or phone numbers.

Properties

Name Meaning
WhatsApp number The SparkBot Number ID used to send the forwarded message. This identifies the sending WhatsApp account.
Target Type of target chat to forward the message to. Options: Phone (individual), Group, Channel.
Phone Number Target phone number in international E.164 format (e.g., +1234567890). Required if Target is "Phone".
Group ID Target group chat ID (e.g., 12345678902401234@g.us). Required if Target is "Group".
Channel ID Target channel ID (e.g., 12345678902402200@newsletter). Required if Target is "Channel".
Message ID to Forward The unique ID of the message to forward. Must be 18-32 hexadecimal characters.
Source Chat ID Optional. The chat ID where the original message belongs. If not provided, the system attempts to discover it automatically.
Options Collection of optional settings including:
- Priority: Normal, High, Low delivery priority.
- Label: Custom label to categorize the message.
- Reference ID: Custom reference identifier.
- Team Agent: Send on behalf of an agent.
- Live mode: Real-time sending without queue.
- Delivery Queue Mode: Controls queuing behavior (default, always queue, never queue, opportunistic).
- Maximum Retries: Number of delivery retry attempts.
- Chat Actions: Post-delivery actions like assigning chat, resolving, marking read/unread, managing labels and metadata.
Message Expiration Defines time-to-live (TTL) for the forwarded message. Can specify expiration in seconds, duration string (e.g., "1h"), or specific date/time.
Mark Chat as Read Boolean flag to notify WhatsApp that previous unread messages in the chat are read after forwarding (blue double-check).
Typing simulation Number of seconds (0-30) to simulate typing or recording status before sending the message. Zero disables this feature.
Quote Message Optionally quote another message by its ID when forwarding. Must be in the same conversation.
Strict Message Order Ensures messages are sent in strict order to the target chat. Useful for chatbots or sequences. Not compatible with live mode or never queue options.

Output

The node outputs JSON data representing the result of the forward message operation. This typically includes confirmation details such as message IDs, status, timestamps, and any metadata returned by the SparkBot API about the forwarded message.

No binary data output is indicated for this operation.

Dependencies

  • Requires an API key credential for authenticating with the SparkBot WhatsApp API.
  • The node depends on SparkBot's backend services to perform message forwarding.
  • Some properties load dynamic options via methods that query devices, groups, channels, team agents, labels, and departments, requiring proper API access and permissions.
  • Proper configuration of the SparkBot API credentials in n8n is necessary.

Troubleshooting

  • Invalid Message ID: If the message ID to forward does not match the required hexadecimal length or format, the node will throw a validation error. Ensure the ID is 18, 20, 24, or 32 hex characters.
  • Target Chat Not Found: Providing an incorrect or missing target phone number, group ID, or channel ID will cause failures. Verify these IDs exist and are accessible by the configured WhatsApp number.
  • Source Chat ID Missing: If the source chat ID is not provided and cannot be auto-discovered, forwarding may fail. Provide the source chat ID explicitly if errors occur.
  • Delivery Mode Conflicts: Using live mode or never queue options with strict message order enabled will cause incompatibility issues. Adjust settings accordingly.
  • Rate Limits and Bans: Sending many messages in real-time mode without queuing can increase the risk of WhatsApp bans. Use queue modes for high-volume sending.
  • Agent or Department IDs: When specifying team agents or departments for chat actions, ensure IDs are valid 24-character hex strings and correspond to existing entities.
  • Typing Simulation: Setting typing simulation too long may delay message delivery unnecessarily; keep within recommended limits.

Links and References

Discussion