By default Zapier limits steps to run no more than 30 seconds. But some processes for the extraction or converting PDF may take much longer.
The solution is to use 3 separate steps as the following:
1. Run Custom API Call for PDF.co: create and send the “async” request. This request will return jobId which represents the unique ID of the created job;
2. Run Zapier Delay as the next step to wait for 1+ minutes. Depending on the size of your input file you may want to increase it up to 5 minutes)
3. Run Custom API Call for PDF.co with job/check to check the result of the job using jobId from the very first step
References: to learn how to customize sample requests and how to set parameters you may want to explore PDF.co API documentation here.
Create Custom API Call and select pdf/makesearchable. This endpoint will turn your scanned PDF into a text-searchable one.
Make sure to add “async”: “true” parameter and turn OFF the “Run As Async” switch so zapier won’t run job/check on this step right away:
This step will post “async” job and will return “jobId” which we will need to use later:
Now insert Zapier’s Delay module and set it to wait for one or more minutes:
Now add one more Custom API Call step but this time select “job/check” in the list of endpoints. This endpoint will check the result of the async job we’ve created on the very first step. You should insert the “jobId” parameter link from the very first step:
If you don’t see “jobId” in linked parameters you can use then click as shown on this screenshot to view all available params to link:
Now this time make sure to enable “Run As Async Job” switch. This will auto repeat a call for job/check if job returned false (or you may disable this one and add one more Zapier Delay + Zapier Custom API Call with job/check steps again):
Finally, run the Custom API Call step that will return “success” and the link to the result or “failed” if job failed for some reason.
For unknown jobs, it will return “unknown” status accordingly.