Encrypted Data Decryption & Dynamic Response Workflow

This workflow is primarily used for the secure reception and processing of encrypted data requests. After receiving encrypted information via Webhook, it utilizes RSA and AES algorithms for decryption to ensure data security during transmission. The system dynamically identifies the user's current operating interface, intelligently branching to handle different data requests, and returns the processed results in an encrypted format, thereby safeguarding user privacy and data integrity. It is applicable in scenarios such as chatbots and appointment systems, enhancing user interaction experience and process flexibility.

Workflow Diagram
Encrypted Data Decryption & Dynamic Response Workflow Workflow diagram

Workflow Name

Encrypted Data Decryption & Dynamic Response Workflow

Key Features and Highlights

  • Receives encrypted data requests via Webhook, decrypts the AES key using an RSA private key, then decrypts the data payload with AES-GCM algorithm to ensure secure data transmission.
  • Parses the decrypted JSON payload and dynamically identifies the user’s current interface (screen), enabling intelligent branching and workflow orchestration.
  • Extracts relevant data (e.g., appointment time slots, seat information) based on different screen states such as APPOINTMENT or DATE_SELECTION_SCREEN, then encrypts and returns the data to ensure integrity and privacy.
  • Flexibly encrypts response messages to guarantee secure interactions with user endpoints like WhatsApp Flows or chatbots.
  • Implements complex encryption, decryption, and data processing logic entirely within code nodes, providing high customizability and scalability.

Core Problems Addressed

  • Resolves the challenge of secure encrypted data transmission and decryption based on Webhook, achieving secure hybrid encryption data exchange (RSA + AES).
  • Enhances user interaction and workflow flexibility by dynamically routing data processing based on the user’s current interface.
  • Avoids plaintext transmission of sensitive data, meeting stringent data protection requirements in high-security scenarios.

Application Scenarios

  • Backend systems of chatbots receiving encrypted requests via Webhook, such as WhatsApp Flows, Facebook Messenger, and other multi-channel messaging platforms.
  • Online appointment systems managing time slots and seat selection, especially where encrypted transmission of sensitive data is required.
  • Any secure data exchange and dynamic workflow response scenarios built on the n8n automation platform.

Main Workflow Steps

  1. Webhook Listener (Webhook1): Receives encrypted POST request data.
  2. Base64 Decoding (move to base64): Converts encrypted fields in the request to binary Buffer format.
  3. Hybrid Decryption (Decryption Code): Decrypts the AES key using RSA private key, then decrypts the actual data payload with AES-GCM mode.
  4. JSON Parsing (Json Parser): Parses decrypted data to extract the user’s current screen and session token (flow_token).
  5. Workflow Branching (Switch): Dynamically selects processing paths based on the screen value, e.g., appointment time or seat data.
  6. Data Processing (Data Extraction Code, Data Extraction Code1): Aggregates and formats appointment time and seat information respectively.
  7. Encrypt Response (Encrypt Return, Encrypt Return1): Re-encrypts processed results using AES-GCM and encodes them in Base64 format.
  8. Respond to Webhook (Respond to Webhook1, Respond to Webhook2): Sends the encrypted response back to the caller via HTTP response.

Involved Systems or Services

  • Webhook: Serves as the data ingress point, receiving external encrypted requests.
  • Custom Code Nodes: Implements encryption/decryption, data parsing, and formatting logic.
  • n8n Built-in Nodes: Switch node for workflow decision-making; Respond to Webhook node for returning responses.
  • Encryption Libraries (Node.js crypto module): Provides RSA and AES-GCM encryption/decryption capabilities.
  • WhatsApp Flows (Example Use Case): Reference front-end interaction channel.

Target Users and Value

  • Automation Developers & Integration Engineers: Developers building secure data exchange and dynamic interaction workflows.
  • Enterprise IT Teams: Teams providing secure encrypted interfaces to protect customer data privacy and compliance.
  • Product Managers & Technical Decision Makers: Product owners aiming to implement complex security logic and multi-path workflows on low-code platforms.
  • Chatbot and Appointment System Operators: Businesses handling encrypted user interaction data and dynamically responding based on different user interfaces.

This workflow enables users to efficiently and securely process encrypted data requests, automatically recognize user operation states, and achieve intelligent dynamic responses, significantly enhancing security and interaction experience.