Skip to main content

Create an agent executor job

import swarmnode

swarmnode.api_key = "YOUR_API_KEY"

swarmnode.AgentExecutorJob.create(
agent_id="15d19ca3-26f1-4adb-9cea-3955b73d9b4e",
payload={"foo": "bar"},
)

Returns a AgentExecutorJob object.

By creating an agent executor job, agent with given agent_id will be executed. payload is an optional parameter that can be used to pass data to the agent. The agent can access the payload via the request parameter:

def main(request):
print(request.payload["foo"]) # prints "bar"