AI agents and automation
How to solve reCAPTCHA in an n8n workflow
n8n has no CAPTCHA node, and it does not need one: two HTTP Request nodes, a Wait node and an IF node form a complete solving loop. This guide builds it for reCAPTCHA v2 at $0.56 per 1,000 and shows the change for v3.
The workflow in one picture
The finished workflow has five nodes in a line, with one loop back:
- Set inputs (an Edit Fields node, or your trigger) provides
pageUrlandsiteKey. - Create task (HTTP Request) posts the task to
/createTaskand receives ataskId. - Pause (Wait) waits three seconds.
- Check result (HTTP Request) posts the task id to
/getTaskResult. - Ready? (IF) sends the item onward when the status is
ready, and back to Pause when it is stillprocessing.
Everything after the IF node's true branch receives the token at $json.solution.gRecaptchaResponse. Node names in this guide are suggestions, but expressions reference them by name, so keep them consistent if you change them. Screens and option labels below match n8n 1.x at the time of writing; check the n8n docs if a label has moved.
Provide the inputs
Start with a Manual Trigger while you build, then swap in a Schedule Trigger or Webhook later. Add an Edit Fields node with two string fields: pageUrl, the full address of the page that shows the widget, and siteKey, the site key from the widget's data-sitekey. If you do not have the key yet, the guide on how to find the reCAPTCHA site key explains where it hides.
Create the task
Add an HTTP Request node named Create task. Set Method to POST, URL to https://gatesolver.com/createTask, turn on Send Body, choose JSON as the body content type and "Using JSON" to specify it. Paste this body; the double braces are n8n expressions that pull the inputs in.
{
"clientKey": "{{ $vars.GATESOLVER_KEY ?? 'YOUR_API_KEY' }}",
"task": {
"type": "ReCaptchaV2TaskProxyLess", "websiteURL": "{{ $json.pageUrl }}",
"websiteKey": "{{ $json.siteKey }}"
}
}
Keeping the key in an n8n variable keeps it out of exported workflow files. Variables are not available on every n8n plan; where $vars is missing, put the key in a field of the inputs node of a private workflow and reference that field instead.
Run the node once. A good reply looks like {"errorId": 0, "taskId": "..."}. A reply with errorId: 1 and an errorCode tells you what to fix, for example ERROR_INVALID_TASK_DATA when the site key expression came out empty.
Wait, then check
Add a Wait node named Pause set to resume after a time interval of 3 seconds. Token tasks are never ready immediately, so waiting before the first check saves a wasted call.
Then add a second HTTP Request node named Check result, also POST, URL https://gatesolver.com/getTaskResult, with this JSON body. It reads the task id from the Create task node by name, which works no matter how many times the loop has run.
{
"clientKey": "{{ $vars.GATESOLVER_KEY ?? 'YOUR_API_KEY' }}",
"taskId": "{{ $('Create task').item.json.taskId }}"
}
Loop until ready
Add an IF node named Ready? with a string condition: {{ $json.status }} is equal to ready. Connect its false output back to the Pause node. n8n allows connections to earlier nodes, and that single wire is the polling loop.
A loop needs an exit for the bad cases too. Add a second IF node on the false branch, before the wire back, named Give up?, with two conditions joined by OR:
{{ $json.status }}is equal tofailed, or{{ $json.errorId }}is equal to 1.{{ $runIndex }}is larger than 40, which is about two minutes of three second waits.
Its true branch goes to a Stop and Error node (or a notification), and its false branch goes back to Pause. Now the workflow ends on its own whether the solve succeeds, fails or takes too long. Tasks that fail or stay unsolved past 120 seconds are not charged.
Use the token
On the true branch of Ready?, the item carries the full result. The token is at {{ $json.solution.gRecaptchaResponse }}, and the User-Agent it was solved under is at {{ $json.solution.userAgent }}. Typical next nodes:
- An HTTP Request that posts the site's form with Body Content Type "Form Urlencoded" and a field named
g-recaptcha-responseholding the token. Send the returned User-Agent as a header. - A call to a browser automation service you run, passing the token so it can fill the page's hidden field.
Use the token within about two minutes, and only once. The g-recaptcha-response entry explains why.
The reCAPTCHA v3 variant
For v3, change the task in Create task: type ReCaptchaV3TaskProxyLess, and add "pageAction": "{{ $json.action }}" with the action name the page passes to grecaptcha.execute. Add an action field to your inputs node. The loop is identical. The token then goes into whatever request the site sends, which is often a JSON API call rather than a form, so look at the page's network tab once to copy the field name. v3 tasks cost $0.70 per 1,000; see reCAPTCHA v3 for the fields.
Running many pages
If the trigger produces several items (a list of pages), n8n runs each item through the nodes. For a handful that is fine. For larger batches, place a Loop Over Items node before Create task with a small batch size, so you do not hit 600 requests per minute on your key with a crowd of polls at once. There is no limit on how many tasks run at the same time.
Common questions
Is there an official GateSolver node for n8n?
No. The HTTP Request node is all you need; the API is two JSON endpoints.
Why does the workflow wait before the first check?
Token tasks are never ready the instant they are created, so the first call would only spend a request.
What does $runIndex count in the Give up node?
How many times that node has run in the current execution, which equals the number of polls so far.
Can the same workflow solve v2 and v3?
Yes. Put the task type in the inputs and add pageAction only for v3, or use two Create task nodes behind a Switch.
Where do I see the cost of a solve?
The getTaskResult reply includes a cost field for the ready task, and your account page shows the balance.
Keep reading
- n8nA reusable n8n solve loop built only from HTTP Request, Wait and IF nodes, with an attempt cap and clean error branches.
- reCAPTCHA v2 solver$0.56 per 1,000 tasks, answers under 9 seconds.
- Find the reCAPTCHA site keyFive dependable places to read a reCAPTCHA site key, from the data-sitekey attribute to the k parameter in network requests.
- Can no-code tools handle CAPTCHAs?Yes, through HTTP request steps: create a task, wait, poll for the answer, then pass it to the next node.