POPOOpenPlatformMessageCardApi Trigger icon

POPOOpenPlatformMessageCardApi Trigger

Starts the workflow on a popo update

Overview

This node acts as a trigger for workflows in n8n, specifically designed to start a workflow when a message card update is received from the POPO Open Platform API. It listens for incoming HTTP POST requests (webhooks) and processes encrypted payloads, decrypting them before passing the data into the workflow. The node also supports test webhooks via GET requests.

Common scenarios:

  • Integrating POPO Open Platform with n8n to automate actions based on message card events.
  • Receiving and processing secure, encrypted webhook notifications from POPO.
  • Building workflows that respond to real-time updates from external systems using POPO's callback mechanism.

Practical examples:

  • Automatically logging or forwarding POPO message card updates to other services.
  • Triggering alerts or notifications in response to specific POPO events.
  • Enriching or transforming POPO webhook data for further automation.

Properties

Name Type Meaning
Respond options Determines when and how the webhook should respond. Options: Immediately (on execution), When Last Node Finishes (after workflow completes), Using 'Respond to Webhook' Node (response defined elsewhere).
Response Code number The HTTP status code to return in the response (100–599). Not used if "Using 'Respond to Webhook' Node" is selected.
Response Data options Specifies what data to return when responding after the last node finishes. Options: All Entries (array), First Entry JSON (object), First Entry Binary (file), No Response Body (no content).
Property Name (for binary response) string Name of the binary property to return when "First Entry Binary" is selected as Response Data.
Options collection Additional settings for webhook handling, including:
- Binary Data: Whether to expect binary uploads.
- Binary Property: Name for storing uploaded file data.
- Ignore Bots: Ignore bot/crawler requests.
- No Response Body: Omit body in response.
- Raw Body: Return raw request body.
- Custom response data, headers, etc.
Insert a 'Respond to Webhook' node to control when and how you respond notice Informational notice shown when "Using 'Respond to Webhook' Node" is selected, with a link to documentation.
Response Content-Type string Custom content-type header for responses (e.g., application/xml), relevant when returning JSON data after the last node.
Response Headers fixedCollection Allows adding custom headers to the webhook response. Each entry includes a Name and Value.
Property Name (for JSON response) string When returning JSON data after the last node, specifies which property to return instead of the whole object.

Output

  • The node outputs an array of items, each with a json field containing the decrypted data from the POPO webhook.
  • For POST requests, the encrypted payload is decrypted and parsed as JSON, then provided as the output.
  • For GET requests (test webhooks), the query parameters are returned as JSON.
  • If configured to return binary data, the output will include a binary field with the specified property name.

Example output structure:

[
  {
    "json": {
      // Decrypted POPO webhook data as key-value pairs
    }
  }
]

If binary data is returned:

  • The output will contain a binary property with the file data, named according to the configuration.

Dependencies

  • External Service: Requires access to the POPO Open Platform API.
  • Credentials: Needs a credential set named popoOpenPlatformMsgCardApi with at least token and aesKey fields.
  • Crypto Library: Uses crypto-js for AES decryption.
  • n8n Configuration: Must be set up as a trigger node with appropriate webhook URLs accessible by POPO.

Troubleshooting

Common issues:

  • Invalid Credentials: If the token or aesKey is incorrect or missing, decryption will fail, and the node may throw errors or output empty/invalid data.
  • Webhook URL not reachable: If the webhook URL is not accessible from POPO, no triggers will occur.
  • Decryption Errors: If the incoming data cannot be decrypted (wrong key, corrupted data), the node may throw parsing or decryption errors.
  • HTTP Status Codes: Misconfiguration of the response code may cause clients to misinterpret the webhook response.

Error messages and resolutions:

  • "Cannot read property 'aesKey' of undefined": Ensure credentials are correctly set up and referenced.
  • "Unexpected token ... in JSON": Indicates decryption failed or the payload is not valid JSON; check your AES key and input data.
  • "Webhook not registered": Make sure the webhook creation step succeeded and the URL is correct.

Links and References

Discussion