1. Template Techniques
  2. External Trigger to Agent

Template Techniques

External Trigger to Agent

Explains how webhooks or Heimdall events can inject external updates into an active AI-agent conversation.

Sometimes and agent will need to be triggered from an external system. This technique can be used to allow agents to proactively respond to events and feedback based on the process being handled.
This technique can be achieved using the heimdall event bus or directly using webhooks.
Each of these methods will result in an action being run on the respective stub and an injection of a system role messge into the agent context.

Detailed Example Structure

  • For a customer support agent that needs to receive updates from a ticket system for a specific customer, the external ticket system can call a webhook for each tickup update
  • On the manage context a webhook action is defined to receive events from an external system and relay the event into the heimdall event bus
  • A receive_system_event action is webhook enabled and has an emit_heimdall task that injects certain payload data into the heimdall path to enable specific stubs to pickup return events automatically eg. "external.customer.support.tickets.[customer_identifier]"
  • On the default context an "on-enter" state task is setup for the state where the customer has been verified via their identifier
  • A register_heimdall task is set to register for the specific customer path eg. "external.customer.support.tickets.c235"
  • The register_heimdall task sets a trigger action as receive_ticket_update
  • The receive_ticket_update action will be triggered on each receipt of a specific customer ticket and contains a gpt_chat_task task that injects a system role message into the agent which will allow the agent to see the details of the ticket update and engage further with the customer.