Overview

This guide demonstrates how to use Smooth to fill in complex, multi-step forms. You’ll learn how to structure the task prompt for these tasks.
1

Write the task instruction

Write detailed instructions that tell the agent exactly what to do. The best practice for form filling is to structure the prompt in 3 parts:
  1. The goal
  2. All information needed to fill-in the form
  3. The expected output
Python
task_instructions = """
Go to octopus.energy and get a quote for gas + electricity. Use the following information:

- 1, Garlic Row, Cambridge CB5 8HW
- Medium consumption

Return the final monthly estimate for all available tariffs.
"""
2

Run the task

Run the task with a higher number of steps.
Python
task = smooth_client.run(
    task=task_instructions,
    max_steps=64,  # Multi-step forms may require many steps
)

print(f"Live URL: {task.live_url()}")

# Get the result
result = task.result()
print(f"Insurance quote result: {result}")
3

Done!

The agent will adapt to the form’s structure, whether it’s a single long page or multiple sequential steps, and handle dynamic fields that appear based on previous selections.

Key Benefits

  • Dynamic Adaptation: Agent handles forms that change based on user input
  • Multi-Step Navigation: Seamlessly moves through complex form sequences
  • Error Recovery: Can handle validation errors and retry with corrected information

Best Practices

  • Give Clear Default Instructions: Specify how to handle missing information scenarios
  • Set Adequate Step Limits: Multi-step forms often require more steps than simple tasks
  • Include Guidance: If needed, tell the agent how to handle common pitfalls

Common Use Cases

You can use this approach for automating a variety of tasks, such as:
  • Transfering data across systems
  • Getting quotes
  • Submitting forms

Community

Join Discord

Join our community for support and showcases