Agents API
Trigger agents from other services using a simple JSON API that returns results
The Agents API now runs on every Open Agent Studio instance. An easy way to test this is to run Ngrok locally, or use Open Agent Studio which publishes a public IP address you can use as your personal Agents API.
The website editor now generates a sample curl request in simple english with the JSON API for you to test. You can install ngrok to run the Agents API locally if you add /agents to the end of the ngrok address like in the above image.
It even returns all the saved agent data during the automation, plus the verification testing loop steps we use to verify each action.
Key Concepts
Nodes: Individual actions an agent can perform Variables: Data that can be passed between nodes Verification: Checking if a node’s action was successful Global Variables: Shared data accessible across all nodes
POST /agents
Creates and runs a new agent based on the provided JSON configuration.Request Body
Response Returns a string representation of the agent’s output data after executing all actions.
Agent Node Types
Desktop+Browser Automation
DelayPauses execution for a specified time.
Types text or presses a key.
Clicks on a specified target in english.
Opens a new browser tab.
Data Processing
GPT4Uses GPT-4 for natural language processing.
Executes custom Python code.
Executes bash commands.
Integrations
Google Sheets CreateCreates a new Google Sheet.
Adds a row to a Google Sheet.
Reads data from a Google Sheet.
Sends an email.
Makes an API call.
Utility
Add DataLoads data from various file types.
Schedules the agent to run at specified times.
Performs a generalized action based on a description using our state machine to solve open-ended problems.
Scrapes data based on a semantic description.
Complete Example: Web Scraping and Data Processing Agent
Best Practices
- Use descriptive names for variables to make the workflow clear.
- Add appropriate delays between actions to allow for page loading.
- Handle errors gracefully by checking node verification results.
- Use GPT-4 nodes to add flexibility and intelligence to your agents.
- Leverage integrations like Google Sheets for data storage and sharing.
- When using the python node, ensure all necessary libraries are imported.
- For file operations in the add_data node, ensure file paths are correct and accessible.
- When scheduling agents with the schedule node, use correct cron syntax.
- For API calls, double-check URL, headers, and body parameters.
- Use the general node for complex actions that may require multiple steps.
By following this documentation, you can create sophisticated automated agents capable of handling a wide range of tasks across multiple platforms and services. The Agents API provides a flexible and powerful framework for defining complex sequences of actions, data processing, and integrations.