Listen for tasks
A taskable agent is an asset entity, or group of entities that can perform tasks.
An agent calls the following API to listen for tasks assigned to it in Lattice:
ListenAsAgent
— Used to monitor and receive tasks.
Before you begin
- To publish taskable entities, and subscribe to tasks, set up your Lattice environment.
- Familiarize yourself with entities and different entity types.
Integrate an agent
An asset is an entity under your control, or under the control of another operator or system. Assets may accept tasks such as search or tracking. An agent is an asset, or a group of assets, that can complete a specific set of defined tasks.
To publish an agent, do the following:
Define a TaskCatalog
The entity model’sTaskCatalog
component defines the tasks that an asset can execute. An operator, using the Lattice UI or
an a programmatic SDK integration, can use an entity override
to modify the asset’s TaskCatalog
.
For example, publish an asset with the following catalog to listen to, and execute VisualId
, Monitor
, and Investigate
tasks assigned to it:
Publish the agent
Use the PublishEntity
method to publish a taskable agent:
If successful, you see the entity ID in the console. Copy the ID:
Listen for tasks
Use the ListenAsAgent
operation and replace AGENT_ID
with the ID of the agent you just published.
This lets the agent subscribe to, and listen for, tasks routed to it by Lattice:
If successful, you see the following output:
Assign a task using the Lattice UI
To assign a task, do the following:
- Open your environment’s Lattice UI, and choose the entity you published from the Assets panel on the left hand side.
- From the entity pane, choose Task, then
select a task, for example,
Follow
. Each displayed task in the drop down corresponds with aTaskDefinition
item in the agent’sTaskCatalog
component: - From the Task Details panel on the right hand side,
select a target from the Targets drop down, then
choose Execute Task:
Endpoints for operators
The operator should use the following endpoints from Lattice UI or a third-party UI:
CreateTask
: Creates a new task. Lattice calls theCreateTask
endpoint after a task’s details have been populated in the UI, and an operator presses “Execute Task” for the first time.GetTask
: Fetches the state of an existing task.QueryTasks
: Finds tasks that match the specified criteria.
What’s next
- To learn more about tasks, see Task an asset.
- See tasks in action with the auto-reconnaissance sample app.