Conversation
Test Results42 tests 42 ✅ 1m 33s ⏱️ Results for commit ac79ad1. ♻️ This comment has been updated with latest results. |
…ton-conected-to-go-to-flow-to-redirect-to-ai-agents
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
vanbasten17
approved these changes
Mar 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
When a user taps a button in the Flow Builder that is connected to a Go to flow action targeting the AI Agents flow, the request is now correctly redirected to the AI Agents flow instead of being handled as a normal flow payload. The plugin detects this case before routing, tracks the flow event, clears the payload, and lets the AI Agents plugin handle the request.
Context
Approach taken / Explain the design
FlowBuilderApi, addedisGotToFlow(id)to determine if a given node ID is a Go-to-flow node. InupdateRequestBeforeRoutes(now async), when the incoming payload is a Go-to-flow node, we resolve it.FlowGoToFlow, added a static methodresolveToAiAgentsFlow(botContext, component, cmsApi). It builds the Go-to-flow content from the CMS node; if the target flow name equals the AI Agents flow constant (AI_AGENTS_FLOW_NAME), it tracks the flow event (for analytics) and setsbotContext.input.payload = undefined. Clearing the payload ensures no flow-builder route matches, so the request falls through to the AI Agents plugin.updateRequestBeforeRoutesbefore routes are evaluated, so the redirect happens once per request and only when the payload is a Go-to-flow pointing to the AI Agents flow.No changes to the AI Agents plugin were required; it already handles requests without a matching payload.
To document / Usage example
In Hubtype CMS (Flow Builder):
No code changes are required in the bot; enabling both
@botonic/plugin-flow-builderand@botonic/plugin-ai-agentswith the same AI Agents flow name is enough.