Skip to main content
This is a step-by-step guide to creating and running your first workflow on the Simplex dashboard. We’ll walk through creating a workflow to fill out the first part of a form on an Aetna healthcare page.

Create an agent

Let’s start by creating a form filling agent. We will keep our prompt high-level so it can be used across a long tail of web portals.
1

Create an agent

Start by creating an agent and name it Form Filler.

Create and name agent

2

Add agent prompt and tools

Add a prompt and agent tools. Variables in the prompt will be automatically detected, like form_info in this prompt.
[wait_for_seconds, click_element, press_enter, scroll_down, scroll_up, type_text]
Your goal is to fill out the fields present on the page with the given <form_info>. New
fields may appear on the page. Simply fill out the fields till no more appear. Do not click
any buttons to save, submit, or move to the next page.

<notes>
  - For dropdowns, use one step to click on the dropdown and another step to select the option.
  - Close any popups that might appear.
  - Only fill fields on the page. Do not click Submit, Continue, or similar buttons to move on.
  - There may be info in <form_field> that are not on the current page. That is okay.
</notes>

<finish_task>
  - Call done when all the fields on the page are filled out.
  - If new fields appear on the page, fill those as well. Ensure no more fields appear on the
  page before finishing the task.
  - Call fail_task with a message if form_info is incomplete.
</finish_task>

<form_info>
  {{form_info}}
</form_info>

Add a prompt and agent tools

Create and run the workflow

1

Install and setup

Install the Simplex Typescript SDK.
npm install simplex-ts
Get a Simplex API key (create one in Account Settings on the dashboard)
2

Create a workflow

Create a new workflow session with the form filling agent.
import { SimplexClient } from '../src/SimplexClient';

const client = new SimplexClient({ apiKey: 'your-api-key' });

(async () => {
    const workflow = await client.createWorkflowSession({
    name: 'aetna-form-sample',
    url: 'https://extaz-oci.aetna.com/pocui/join-the-aetna-network'
    });

    const workflowId = workflow.workflowId
    
    // use your agent name
    await workflow.runAgent('Form Filler');

    await workflow.close();
})();
3

Run the workflow

You can trigger the same workflow repeatedly with different variables. Navigate to the Livestream URL to view the live session and agent logs on the Simplex dashboard.
const result = await client.workflows.run(workflowId, {
    form_info: {
        interested_in: 'Aetna',
        applying_for: 'Behavior Health',
        joining: 'A individual provider applying under a SSN or TaxID/EIN'
      }
})

console.log('Session created:', workflow.sessionId);
console.log('Workflow ID:', workflow.workflowId);
console.log('Livestream URL:', workflow.livestreamUrl);