Recursively call the DeepL status API every 5 seconds until the translation is complete

I’m using DeepL to translate documents, but some translations can take a minute or longer. DeepL provides a document translation status endpoint that you can call to check if an error occurred or if the document is still being translated: https://api-free.deepl.com/v2/document/{{document_id}}.

What would be the best way to handle this process? First, launch the translation using: https://api-free.deepl.com/v2/document to get the {{document_id}} from the response. Then, recursively call https://api-free.deepl.com/v2/document/{{document_id}} every 5 seconds until the translation is complete before proceeding with the rest of the Make scenario.

Welcome to the Make community!

There are two methods if you want to do a polling wait in the same/single scenario.

Method 1 — difficulty level: Easy

The simplest solution would be to use a Sleep module to wait out 5 minutes (or the longest period that the external service takes).

You could even use more than one, if you have a Make subscription (free tier max 5 minutes per scenario run).

Method 2 — difficulty level: ???

This other method allows you to check multiple times at shorter intervals, because you “throw” an error to break from the repeater and end the scenario when successful/completed.

The secret is in the success check filter, the error handler, and the commit directive.

Hope this helps! Let me know if there are any further questions or issues.

@samliew

P.S.: Investing some effort into the Make Academy will save you lots of time and frustration using Make.