1. Blocks
  2. Stub Sessions Block

Blocks

Stub Sessions Block

Displays active stub sessions for incoming message routing.

Use cases

The Stub Sessions block displays all active stub sessions associated with the current stub. Stub sessions are how Stubber tracks which stub and action to run when receiving incoming messages from notification platforms like WhatsApp, Webchat, or SMS.

When an action runs on a stub and sends an outgoing message to a specific number or session UUID, Stubber creates a stub session containing:

  • The recipient number/session UUID
  • The active stubref
  • The active feedback action
  • A time-to-live (TTL)

When an incoming message is received, Stubber checks for an active stub session for that number/session UUID and runs the associated feedback action on that stub. If no feedback action is saved in the stub session, the default feedback action for that notification platform is used (e.g., _update_from_whatsapp).

The Stub Sessions block allows you to monitor and debug active sessions, see which notification platforms have active sessions, and track session TTLs.

Basic usage

This example block is added to the stub layout via the layout editor and is only visible to stubber authenticated users.

loading...

Tabbed mode

You can configure the block to display sessions grouped by notification platform using tabs. Set params.use_tabs to true:

loading...

In tabbed mode, sessions are organized by platform (WhatsApp, Webchat, etc.), and you can switch between platforms to view their active sessions.

Non-tabbed mode

Without the use_tabs parameter (or set to false), all active sessions from all notification platforms are displayed together in a single view. This is also the default behavior if the parameter is omitted.

loading...

Session information

Each stub session displays the following information:

  • Send To Number (WhatsApp/SMS) or Session UUID (Webchat) - The recipient identifier
  • Session TTL - Time remaining before the session expires
  • Stubref - The stub that will handle incoming messages
  • Feedback Action - The action to execute on incoming messages