- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
an hour ago
In Q1 2026, we introduced the Use an AI agent Flow action for Subflows.
If within the context of AI agent tooling, you can use the AI agent’s Subflow Tool to invoke another AI agent within the same execution thread. The invocation pattern would look like this:
AI agent 1 (parent agent) -> Subflow Tool -> Subflow -> Flow action: Use an AI agent -> AI agent 2 (sub-agent)
Note that the two AI agent executions will be on separate Execution Plans [sn_aia_execution_plan], with separate Conversation IDs [sys_cs_conversation].
Prerequisites
For this example, I’m running the following:
- Australia Patch 3 Hotfix 1 (although this feature is available in earlier versions)
- Now Assist AI Agents [sn_aia] 8.0.12
- Flow Designer – Designer [sn_flow_designer] 29.3.1
- At least one working, activated AI agent created for the sub-agent execution. My Egg Frying Agent will help us fry the perfect egg.
Create the sub-agent
I’m going to use an Egg Frying Agent to demonstrate the sub-agent capabilities. Use whatever AI agent you want for the sub-agent.
Go to AI Agent Studio > Create and manage. Select the AI agents sub-list. Select the Add button, or select the Add dropdown, and select Chat.
Create an AI agent with these details. Under the Define the specialty section, fill in the following:
- AI agent name: Egg Frying Agent
- AI agent description: This agent helps users learn how to fry an egg by offering detailed instructions and practical tips. It is intended for anyone seeking guidance in basic cooking techniques, from beginners to those wanting to refine their skills.
- AI agent role: The agent acts as a culinary assistant specializing in providing step-by-step instructions for frying eggs. It communicates clearly, adapts its guidance to the user's skill level, and ensures safety and accuracy in the cooking process. The agent is designed to be approachable, informative, and supportive, making the cooking experience easy and enjoyable.
- List of steps:
Expertise: Cooking, specifically frying eggs.
1. Provide clear, step-by-step instructions for frying an egg.
2. Return response in the following JSON format:
{
"data": {
"recipe": "<the recipe for frying egg>"
}
}
My Egg Frying Agent just uses a basic Web Search tool to scrape the egg frying recipe information:
Continue with the creation of your AI agent. Add any security controls, triggers, and select channels as necessary. Make sure you activate your AI agent.
Create the Subflow
Go to Process Automation > Flow Designer:
Under Subflows, select New > Subflow:
If you have Now Assist for Creator enabled, select Build on your own.
Then, in the New Subflow window, enter the Subflow name, Application scope, and Description for the Subflow:
Select the Build subflow button. Expand the Subflow Inputs & Outputs section. Create an Output using the (+) button, like this. Then, select Done:
Under Actions, select Action > Installed Spokes > ServiceNow Core > Use an AI agent:
In the Action Inputs, enter the following:
- AI agent: <your AI agent that you want to run as a sub-agent>
- Support User: <the user that you want this Execution Plan to created for, select someone or return a sys_user’s sys_id via script>
- Objective: <the task instructions to be given to the sub-agent>
- Wait for completion: <check if you want the sub-agent’s execution response to be synchronous. If you don’t care, and you are okay with parallel completion with the parent agent, don’t check>
- Execution mode: <select Supervised for human-in-the-loop approval, Autonomous otherwise>
- Expected outputs: <enter any response outputs from the sub-agent, helps a lot if the sub-agent returns the response in JSON format>
- Conversation label: <enter the label that you want to appear in the Conversation when it’s created>
- Context Memory: <enter memory in a String that you want to use in this sub-agent’s execution>
When finished, select Done in the Action configuration.
Under the Action, add a Flow Logic for Assign Subflow Outputs:
In the Assign Subflow Outputs block, select your Output name, and use the data pill picker to select the sub-agent’s response output that you defined in the Action:
When finished, select Done in the Assign Subflow Outputs block.
Test the Subflow
Be sure to Test and Publish your finished Subflow:
Observe that the Output and Agent Output are populated with a proper response value:
Create the parent AI agent
Go to AI Agent Studio > Create and manage. Select the AI agents sub-list. Select the Add button, or select the Add dropdown, and select Chat.
Create an AI agent with these details. Under the Define the specialty section, fill in the following:
- AI agent name: Breakfast Planning Agent
- AI agent description: This agent assists users in planning their breakfast by offering customized meal suggestions based on preferences, dietary needs, and available ingredients. It is designed for anyone seeking guidance to make their morning meal enjoyable, nutritious, and convenient.
- AI agent role: The agent acts as a personalized breakfast planner, engaging users in a friendly and informative manner. It gathers user preferences, dietary restrictions, and available ingredients to suggest balanced and appealing breakfast options. The agent communicates clearly, adapts recommendations based on feedback, and ensures that suggestions are practical and tailored to individual needs. It maintains a supportive tone and prioritizes user satisfaction and health.
- List of steps:
# Breakfast Agent
## Expertise
Breakfast meal planning. You specialize in either fried-egg recipes or alternative breakfast options based on user preference.
## Decision Tree
**Step 1: Ask the user if they like fried eggs.**
**Path A: User likes fried eggs**
- Invoke Egg Frying Subflow tool to retrieve the recipe
- Summarize and present the recipe
- Stop
**Path B: User doesn’t like fried eggs**
- Ask about dietary preferences (allergies, restrictions, vegan/vegetarian, low-carb, etc.)
- Recommend 2-3 quick, balanced breakfast options that fit their constraints
- Offer to adjust recommendations if they ask for alternatives
## Validation
- All suggestions must be genuinely achievable in ≤20 minutes
- Flag allergies or severe restrictions immediately
- Don’t recommend fried eggs if the user has rejected them
At the bottom of Define the specialty, select Save and continue.
Under Add tools and information, select the Add tool dropdown. Select Subflow. Fill in the Subflow tool as follows:
- Select subflow: Egg Frying Subflow
- Name: Call Egg Frying Subflow
- Tool description: Provides the user with instructions for how to fry an egg. Inputs: None. Outputs: Recipe for frying an egg.
- Execution mode: Supervised
- Display output: Yes
Add the Tool (or Save if in edit mode). Your Tool should be created now:
Continue with the creation of your AI agent. Add any security controls, triggers, and select channels as necessary. Make sure you activate your AI agent.
Testing the parent AI agent
Go to AI Agent Studio > Testing. Start a manual test, like this:
Select Continue to test chat response. Observe the AI agent execution in the test pane.
Since the “Call Egg Frying Subflow” tool is configured in Supervised mode, we must approve the tool execution when prompted by the AI agent. Afterwards, we get a response from the sub-agent.
The sub-agent returns an output in JSON, which the parent AI agent (Breakfast Planning Agent) converts to a readable summary from its prompt instructions:
Here’s the decision log from my sample test execution:
Furthermore, upon inspection of the Execution Plan [sn_aia_execution_plan] list, I have two unique Execution Plans, each with its own Conversation [sys_cs_conversation] record:
Testing edge cases
Supervised vs. Autonomous: For the situation of one AI agent invoking another via the Subflow tool, the Supervised vs. Autonomous Execution mode setting at the parent AI agent’s Subflow tool level seems to override any settings on the Subflow’s Flow action or in the sub-agent’s additional tools. Test your configuration!
Wait for completion: If I do not configure the Flow action with Wait for completion checked, then I get a broken execution since my parent agent was expecting a response in its prompt instructions.
Again, this could be an acceptable path for you if your prompt instructions do not call for the sub-agent’s output to be available to the parent agent’s execution (asynchronous).
Resources
- Use an AI agent action: https://www.servicenow.com/docs/r/build-workflows/workflow-studio/use-an-ai-agent-action.html