Intro
AI Agent Tasks in Workflows bring intelligent automation directly into your business processes.What is an AI Agent?AI Agents can perform tasks on behalf of a person or system by using tools, data, and workflows. When an AI Agent is embedded directly into a workflow step, it can analyze inputs, make context-aware decisions, and execute actions to reduce manual effort and increase operational efficiency. Employing Domo global and custom functions enables your agent to go beyond thinking and actually do.
Build an Agent
Follow the steps below to add an Agent Task to your workflow. During this process, you’ll prompt the AI Agent and provide instructions on its role, add context to inform the agent, test the agent, and review its output.-
While
creating a workflow, select
Add action > AI Agent Task to open the right configuration panel.

- In the configuration panel, add a name and optional description for the agent.
- Select Build Agent to open the agent modal.
- (Optional) In the modal’s General tab under Model, follow the link to choose a different available model in the AI Service Layer settings.
- In the Prompt field, add an input prompt in natural language to tell the agent what you want it to do.
-
Use the Insert dropdown to add variables to your prompt as needed. At runtime, the variables pass dynamic values into the prompt.
In this example, the agent is being built to determine whether a sales lead meets certain qualifications, listed in the prompt. A variable is inserted for each qualification to hold the information.

-
Company name:
Company\_Name -
Industry:
Industry -
Company size:
Company\_Size -
Contact name:
Contact\_Name -
Contact email:
Contact\_Email -
Estimated budget:
Estimated\_Budget -
Location:
Location
Use a single variable as your prompt:This checkbox allows you to map a single text variable for the prompt. Any text stored in the variable will be passed into the prompt at runtime.
-
Company name:
-
Use the Instructions field to tell the agent what role it plays, the directions or steps it should follow, and how to behave. The AI will honor these instructions for every prompt. The more instructions you give, the more fine-tuned the agent’s results.
In our example, we provide the following instructions to the sales lead agent: “You are a sales assistant bot that helps qualify new leads and assign them to the best-fit sales representative. If the sales lead qualifies, please also assign it to the appropriate sales rep and send them a notification that includes the lead details and the reason it qualifies, and ask the sales rep to follow up with the company. If the sales lead does not qualify, please send a notification to John at john.doe@example.com with the reason why the lead did not qualify.”

-
Go to the Tools tab of the modal and select Add Tools.

-
Search for and select the function package you want to use to display the functions inside. You can choose from Domo global functions and custom functions created in your instance.

-
Check the box for each function that you want the agent to use.
In our example, we choose a custom sales qualification package and the qualification function.

- Select Add Tools to return to the Tools tab.
-
Repeat the steps in this section to add as many tools as needed for your agent.
In our example, we also add a notification function that sends an email.

-
Select each function in the Tools tab to open its configuration details.

- Add or edit the function’s description to help the AI understand the function’s purpose and how to use it.
- Under Parameters, add descriptions for each input parameter to help the AI understand what data values it should map and use during execution
- (Optional) Check the Static Value checkbox for any input parameter where you want to always use a specific value in the mapping. Note: The default option is to leave these boxes unchecked, which means the AI agent will automatically decide what data to map based on the details provided in the prompt, instructions, or Knowledge tab.
- Select Save.
- Go to the Knowledge tab of the agent modal.
-
Add any DataSets, FileSets, and Files you want the AI to reference to help with analysis and decision-making. You can add up to five items of each type.

- Return to the General tab.
- At the bottom of the left pane under Output, select Edit.
-
Give your output parameter a name, data type, and description to tell the agent what value to produce. Outputs tell the agent what data to return after completing your request. You can use a defined object, and the agent will retrieve those values and pass them to the mapped variables so that the data can be used in later steps of the workflow. Give each child property a description so the agent knows what values to provide for each output parameter. If no outputs are defined, the agent will return the JSON object using data it has gathered throughout the execution.

- Repeat for as many outputs as needed.
- Select Save.
- In the right panel of the agent modal, select Test Agent.
- Add values for any variable used in your prompt and select Continue.
-
Review the testing results to ensure you are satisfied with the outcome, then select Save to return to the workflow canvas. The results include the data the AI accessed, the steps it followed to process the task, and the resulting output values.

- Map your AI Agent task outputs in the configuration panel to store the value produced by the AI for later use in downstream steps.
Best Practices
- While configuring your agent, use the Save option in the top right of the agent modal often to avoid losing updates to your agent.
- After testing your agent, make any needed changes to the configuration and re-run the test. We recommend retesting the agent multiple times to make sure you are getting accurate and consistent results.
Reopen or Edit an Agent
In the workflow’s right configuration panel, select the three vertical dots icon > Edit to reopen the agent modal and make changes to the agent.