Basic automation task
This section shows you how to configure and execute a basic automation task using our SDK.Step 1: Configure the task
First, use theagent.run
method to define what you want the agent to do. This method takes a natural language prompt and returns a task object you can track and manage.
Code | Description |
---|---|
agent.run() | Tells your agent what to do in natural language. |
await task.waitForCompletion() | Pauses execution until the task is complete. |
Step 2: View task results (Optional)
You can view task results in real time or after completion by monitoring events.Option 1: Real-time updates
Option 2: Full event log (after completion)
Filling a form
This section shows you how to configure your agent to execute a more complex workflow, such as filling a form, using our SDK.Step 1: Configure the task
Use theagent.fillForm()
command with a single argument. This should be either a string URL for legacy usage or a structured object for full form automation.
Structured object approach (recommended):
url
: The web page containing the form.fields
: Key values descrbing the form’s data.