Agent inputs and outputs
Inputs and outputs allow data to flow between agents in a structured, reliable way.
26 steps
2 minutes
Getmagical
Creating inputs and outputs
**Inputs** are structured data that is passed to an agent from its "parent" agent. **Outputs** are structured data that is returned to the parent agent once the "child" is finished with its task.
1
Navigate to an agent
2
Click the plus icon to add an input
3
Give your input a name
4
Select the type of input from the dropdown menu:\ \ **Text:** Words, letters, or sentences - basically anything you'd type (e.g., names, emails, descriptions) **Number:** Any numeric value - whole numbers or decimals used for amounts, counts, or measurements (e.g., 5, 99.99, -10) **Boolean:** A simple yes/no or true/false value **Enum:** A fixed list of options (e.g., picking "Small", "Medium", or "Large" for a size) **Array:** A list of multiple values stored in a specific sequence **Object:** A container that holds related information together, like a contact card with name, phone, and address **File Asset:** A link to a file like a photo or document
Inputs and outputs may be... **Optional**, meaning they may not be present on every run **Null**, meaning they may be an empty value
5
Click "Save"
6
Click on an input or output "chip" to edit it
7
To use inputs in an agent's instructions, type @ and select the relevant input from the menu
When instructions are sent to an agent, the input *name* is replaced with the input *value* (e.g. "firstName" would appear as "Bob").
8
An agent's inputs and outputs may also be shared with other connected agents by turning on this toggle
**Important note**: If an agent uses a shared input in its instructions, that input must already exist (i.e. the value is populated) *before* the agent begins its task.\ \ An automation always runs in a straight line, even though it looks like a tree while you're building. A "parent" cannot use shared inputs that are created by its children, since the parent will run before these values exist.
Objects
9
Since an Object input acts as a container, you'll need to add a "property" for each input that should live within it - think of these as nested inputs
10
Click the pencil icon to rename each property
11
Give your property a descriptive name and click the checkmark to save it
12
Fill in the remaining fields for each property (e.g. type of input, optional, null, etc.) and continue to add more properties as needed by clicking the "Add property" button
reportStop with outputs
13
When an agent is finished its task, it must report that its run is complete and provide an outcome back to its "parent". The very last step for every agent should always be the "reportStop" command (though you may have more than one "reportStop" command if your agent contains conditional logic).
14
A best practice is to use the Enum type for outputs to neatly categorize the outcome of the agent's run
15
Click "Add option" and give each outcome a name (your agent will be required to select one of the provided options)
16
Click "Save"
17
Type [[/]] and select the reportStop command from the menu
18
Indicate whether the status of the agent at this point in time would be "Success" (i.e. an intended outcome was achieved) or "Fail" (i.e. something went wrong)
19
Fill in the agent's output value(s) Typically, you'll do this one of the following ways: - If you are using the Enum output type, simply type in the relevant option - Prompt the agent on how it should determine the appropriate value
20
Click "Done"
callSpecializedAgent with inputs
21
When an agent requires a "child" to handle a task, it must call it. Use the callSpecializedAgent command and provide the input values that agent requires.
22
Within the "parent" agent, type [[/]] and select the callSpecializedAgent command
23
Click on the agent you'd like to call
24
Click here.
25
Fill in the selected agent's input value(s) Typically, you'll do this one of the following ways: - Type [[@]] to select an existing input and pass on its value - Prompt the agent on how it should determine the appropriate value - Simply type the exact value
26
Click "Done"
Agent inputs and outputs
Inputs and outputs allow data to flow between agents in a structured, reliable way.
26 steps
2 minutes
Getmagical
Creating inputs and outputs
**Inputs** are structured data that is passed to an agent from its "parent" agent. **Outputs** are structured data that is returned to the parent agent once the "child" is finished with its task.
1
Navigate to an agent
2
Click the plus icon to add an input
3
Give your input a name
4
Select the type of input from the dropdown menu:\ \ **Text:** Words, letters, or sentences - basically anything you'd type (e.g., names, emails, descriptions) **Number:** Any numeric value - whole numbers or decimals used for amounts, counts, or measurements (e.g., 5, 99.99, -10) **Boolean:** A simple yes/no or true/false value **Enum:** A fixed list of options (e.g., picking "Small", "Medium", or "Large" for a size) **Array:** A list of multiple values stored in a specific sequence **Object:** A container that holds related information together, like a contact card with name, phone, and address **File Asset:** A link to a file like a photo or document
Inputs and outputs may be... **Optional**, meaning they may not be present on every run **Null**, meaning they may be an empty value
5
Click "Save"
6
Click on an input or output "chip" to edit it
7
To use inputs in an agent's instructions, type @ and select the relevant input from the menu
When instructions are sent to an agent, the input *name* is replaced with the input *value* (e.g. "firstName" would appear as "Bob").
8
An agent's inputs and outputs may also be shared with other connected agents by turning on this toggle
**Important note**: If an agent uses a shared input in its instructions, that input must already exist (i.e. the value is populated) *before* the agent begins its task.\ \ An automation always runs in a straight line, even though it looks like a tree while you're building. A "parent" cannot use shared inputs that are created by its children, since the parent will run before these values exist.
Objects
9
Since an Object input acts as a container, you'll need to add a "property" for each input that should live within it - think of these as nested inputs
10
Click the pencil icon to rename each property
11
Give your property a descriptive name and click the checkmark to save it
12
Fill in the remaining fields for each property (e.g. type of input, optional, null, etc.) and continue to add more properties as needed by clicking the "Add property" button
reportStop with outputs
13
When an agent is finished its task, it must report that its run is complete and provide an outcome back to its "parent". The very last step for every agent should always be the "reportStop" command (though you may have more than one "reportStop" command if your agent contains conditional logic).
14
A best practice is to use the Enum type for outputs to neatly categorize the outcome of the agent's run
15
Click "Add option" and give each outcome a name (your agent will be required to select one of the provided options)
16
Click "Save"
17
Type [[/]] and select the reportStop command from the menu
18
Indicate whether the status of the agent at this point in time would be "Success" (i.e. an intended outcome was achieved) or "Fail" (i.e. something went wrong)
19
Fill in the agent's output value(s) Typically, you'll do this one of the following ways: - If you are using the Enum output type, simply type in the relevant option - Prompt the agent on how it should determine the appropriate value
20
Click "Done"
callSpecializedAgent with inputs
21
When an agent requires a "child" to handle a task, it must call it. Use the callSpecializedAgent command and provide the input values that agent requires.
22
Within the "parent" agent, type [[/]] and select the callSpecializedAgent command
23
Click on the agent you'd like to call
24
Click here.
25
Fill in the selected agent's input value(s) Typically, you'll do this one of the following ways: - Type [[@]] to select an existing input and pass on its value - Prompt the agent on how it should determine the appropriate value - Simply type the exact value
26
Click "Done"