API Workflow
API Workflow is a feature in ScrapeAutomate that allows users to save, and reuse request configurations for the Scraper API. It's particularly useful for storing complex or frequently used configurations, saving time and reducing errors in repeated API calls.
Key benefits of API Workflow include:
- Saving and reusing request configurations
- Easy management of configurations
- Simplified API calls using workflow IDs
- Separated analytics for specific configuration's
Create a workflow
Creating a workflow is very easy, first go to the builder page and configure your request.
When you are done click on the "Save as workflow" button right under the editor to create a workflow, when you click on the button It will ask you for a name for the workflow. You can set the name as anything you would like:
And finally click on submit and it should create the workflow! When you go to the workflows page you should see your workflow there!
Using an workflow
To use an api workflow you will need to get the ID of the workflow, to get the api workflow id, go to the workflow list page and you should see a column called row which has the ID of the workflow you want to run:
After copying the ID, send the workflow id as a query parameter with your api key to run the scraping request, After you run the request you should get the response:
- Axios
- Curl
const axios = require('axios').default;
const options = {
method: 'GET',
url: 'https://api.scrapeautomate.com/scraper',
params: {
apiKey: '<exampleToken>',
workflow_id: 'cm1zwux5s000012i655qokya5',
},
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
curl --request GET --url 'https://api.scrapeautomate.com/scraper?apiKey=<exampleToken>&workflow_id=cm1zwux5s000012i655qokya5'
Edit an workflow
To edit a workflow, you can go to the workflows page and click on the actions button on the workflow you want to edit, you should see a edit button there. Click on it.
After clicking on it, you should see a builder like page which you can use to change your configuration. When you are done changing your configuration you can either create a new workflow or update the current workflow.
Archiving a workflow
If you want to archive/delete a workflow you can do it by going to the workflow list and clicking on the action button for the specific workflow you want to archive. Like this:
After you archive a workflow you should be able to see it in the archived tab inside the workflow list.