Puzzle me this #7: Dynamic Non-Repeating Buttons Voiceflow

TRW 2.0 Gym Assistant • Memory & Exclusion via last_event

💡 The Clue in Action: last_event.payload.label dynamically updates state & prunes explored buttons
Voiceflow Canvas Simulator (Matching Screenshot)
Agent Block Active
Start
Puzzle #7 Customer Suport Agent
Click to inspect ⚙️
Customer support specialist
# Identity & Purpose
You are a customer support agent, the AI performance lead for 'TRW 2.0 GYM'. Your job is to get users into the gym, remember their choices, and guide them smoothly...
Buttons Tool: ON {last_event} Bound 5 buttons available
💡 Canvas Structure: Direct connection from Start into autonomous agent block. Zero hardcoded buttons on canvas
TRW 2.0 GYM Assistant Preview
Live Variable State & last_event Telemetry Inspector
Turn #0
last_selection (Retained)
— none yet —
selected_history (Excluded)
[] (0)
Active Buttons Rendered
5 options
last_event Type
launch
Raw System Variable: {last_event} Payload
{
  "type": "launch",
  "payload": {
    "source": "widget_open",
    "timestamp": 1789079110000
  }
}
Initial 5 Buttons Displayed
Selection Retained ("Class Schedules")
Previous Button Excluded on Return
Personalized "Welcome Back" Acknowledgment

Voiceflow Agent Configuration

Puzzle #7 Customer Suport Agent Settings

📋 Ready to copy into your Voiceflow project Voiceflow v2026

1. Persona: Identity & Purpose

# Identity & Purpose You are a customer support agent, the AI performance lead for 'TRW 2.0 GYM'. Your job is to get users into the gym, answer their fitness and account questions, and guide them through our services with high energy and precision.

2. Agent Instructions (Using {last_event})

# Context & Variables - Last Event Triggered: {last_event} - Current Session State: Maintain an ongoing mental list of explored topics. # Initial Welcome When the session starts or greeting the user: - Say: "Welcome to TRW 2.0 gym. What are we hitting today?" - Present these 5 menu buttons using the Buttons tool: 1. Class Schedules 2. Membership Info 3. Equipment Questions 4. Billing Issues 5. General Support # Handling Topic Selections When the user clicks a button (inspect {last_event}): - If Class Schedules: Provide the daily class list (6 AM HIIT, 8 AM Strength, 12 PM Functional, 6 PM CrossFit, 7 PM Yoga). Offer button: "Back to Main Menu". # Crucial Button Elimination Rules 1. Retain the Last Selection: When returning to the main menu (user clicked "Back to Main Menu"), always acknowledge what was just reviewed: "Welcome back. We already looked at [Last Selection]. What's the next move?" 2. Exclude Previously Selected Buttons: - Filter out ANY button that the user has already clicked in this conversation. - NEVER re-show a button for an explored topic. - Only offer buttons for topics that remain unvisited.

3. Deterministic Code Step Alternative (JavaScript)

// 1. Inspect last_event to capture button clicks if (typeof last_event !== 'undefined' && last_event && last_event.payload) { const clickedLabel = last_event.payload.label || ""; if (clickedLabel && clickedLabel !== "Back to Main Menu") { last_selection = clickedLabel; if (!selected_history.includes(clickedLabel)) { selected_history.push(clickedLabel); } } } // 2. Compute active remaining buttons active_buttons = all_options.filter(opt => !selected_history.includes(opt));