Skip to main content
Skip table of contents

Check Recent Conversations

Node

Check Recent Conversations

Description

This node image-20250813-145909.png checks if the customer has a recent conversation and routes accordingly.

Execution & Payload Details:

  • Reads from:

    • msg.payload.customer_id (string/number)

    • msg.payload.channel_type (string)

    • msg.payload.direction (string)

  • External call:

    • getCustomerRecentConversation(customer_id, channel_type, direction) → returns a conversation object or null.

  • Writes to:

    • msg.payload.has_recent_conversation (boolean)

    • msg.payload.recent_conversation (object or null)

  • Routing (two outputs):

    • Output 1: when has_recent_conversation === true

    • Output 2: when has_recent_conversation === false

  • Behavior:

    • Logs progress.

    • On error: logs, calls node.error(...), and done(err); message is not forwarded.

  • Example:

    • Input: payload = { customer_id: "123", channel_type: "CHAT", direction: "INBOUND" }

    • Output fields added:

      • If found: has_recent_conversation = true, recent_conversation = { ... } → sent to output 1

      • If not: has_recent_conversation = false, recent_conversation = null → sent to output 2

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.