Convert to Workflow
After an AI agent completes a task, you can convert the successful run into a reusable workflow. The workflow replays the same steps without needing the AI model - making it faster and cheaper.
How It Works
- The AI agent records every action it takes during a session
- When the session completes, you can convert it to a workflow
- The conversion creates workflow nodes for each navigation, click, type, wait, and extraction step
- Self-healing: if the agent retried an extraction, the final successful version is used
- The workflow can then be scheduled and run repeatedly
Via the Dashboard
- Run an AI agent session and wait for completion
- Click Convert to Workflow on the results page
- Review and optionally edit the generated workflow
- Save and schedule if needed
Via the API
POST https://api.scrayle.com/api/v1/ai/agent/{jobId}/convert
Headers:
x-api-key: YOUR_API_KEY
Response:
{
"workflowId": "wf_abc123",
"name": "Converted from AI Agent - job_xyz",
"nodeCount": 8
}What Gets Converted
The conversion translates AI agent actions into workflow nodes:
| Agent Action | Workflow Node |
|---|---|
| Navigate to URL | navigate_to_url |
| Click element | click_element |
| Type text | type_text |
| Wait for element | wait_for_element |
| Extract data | extract_data |
| Execute code | execute_code |
| Scroll page | scroll_page |
💡Self-Healing
If the AI agent retried an extraction (e.g., because a selector failed on the first attempt), the conversion uses the final successful extraction, not the initial broken one.
Benefits
- Faster execution - No AI model inference needed, runs in milliseconds per step
- Lower cost - Workflow runs cost 5 credits (vs. potentially hundreds for AI agent)
- Schedulable - Run the workflow on a cron schedule
- Editable - Modify individual steps in the visual workflow builder
- Reliable - Deterministic execution of the same steps every time