Tutorials

n8n + CaptchaAI: No-Code CAPTCHA Solving Workflow

n8n is an open-source workflow automation tool with native loop support, making it more flexible than Zapier for CAPTCHA solving. You can build a submit → poll → use workflow that retries automatically until the solve completes.


Workflow overview

Manual Trigger / Cron
    ↓
HTTP Request: Submit CAPTCHA
    ↓
Wait: 10 seconds
    ↓
Loop: Poll until solved
    ├── HTTP Request: Get result
    ├── IF: status == 1? → Exit loop
    └── Wait: 5 seconds → Loop again
    ↓
HTTP Request: Use token

Node 1: Submit CAPTCHA

Add an HTTP Request node:

Setting Value
Method POST
URL https://ocr.captchaai.com/in.php
Body Content Type Form URL Encoded

Body parameters:

Name Value
key {{ $credentials.captchaaiApiKey }} or hardcode your key
method userrecaptcha
googlekey 6Le-SITEKEY
pageurl https://example.com
json 1

Response:

{
  "status": 1,
  "request": "71823456"
}

Node 2: Wait

Add a Wait node:

Setting Value
Wait Time 10
Unit Seconds

This gives the solver time to start processing before the first poll.


Node 3: Poll result (with loop)

n8n supports loops through the Loop Over Items node or by connecting an IF node's false output back to a previous node.

Option A: Simple IF loop

Add an HTTP Request node (Poll):

Setting Value
Method GET
URL https://ocr.captchaai.com/res.php
Query Parameters key, action=get, id={{ $json.request }}, json=1

Connect it to an IF node:

Condition Value
Value 1 {{ $json.status }}
Operation Equal
Value 2 1
  • True output → Continue to the next action (use token)
  • False outputWait (5 seconds) → back to Poll node

Option B: Code node

For more control, use a Code node:

const apiKey = 'YOUR_API_KEY';
const taskId = $input.first().json.request;

for (let i = 0; i < 24; i++) {
  await new Promise(r => setTimeout(r, 5000));

  const resp = await fetch(
    `https://ocr.captchaai.com/res.php?key=${apiKey}&action=get&id=${taskId}&json=1`
  );
  const data = await resp.json();

  if (data.status === 1) {
    return [{ json: { token: data.request, taskId } }];
  }
  if (data.request !== 'CAPCHA_NOT_READY') {
    throw new Error(`CaptchaAI error: ${data.request}`);
  }
}

throw new Error(`Task ${taskId} timed out`);

Node 4: Use the token

Add another HTTP Request node to submit the form with the solved token:

Setting Value
Method POST
URL https://target-site.com/submit
Body Content Type Form URL Encoded

Body parameters include your form data plus:

Name Value
g-recaptcha-response {{ $json.token }}

Storing the API key securely

Use n8n's Credentials system:

  1. Go to Credentials → Add Credential → Header Auth
  2. Name: CaptchaAI API Key
  3. Store the key securely

Or use environment variables:

# In your n8n environment
export CAPTCHAAI_API_KEY="your_key_here"

Reference in nodes: {{ $env.CAPTCHAAI_API_KEY }}


Image CAPTCHA workflow

For image CAPTCHAs, adjust the Submit node:

Name Value
method base64
body Base64-encoded image (from a previous node or URL)

To convert an image URL to base64 in n8n, add a Code node before the submit:

const imageUrl = $input.first().json.imageUrl;
const resp = await fetch(imageUrl);
const buffer = Buffer.from(await resp.arrayBuffer());
const base64 = buffer.toString('base64');

return [{ json: { imageBase64: base64 } }];

Balance check workflow

Create a separate workflow that runs on a schedule:

Cron (daily at 9 AM)
    ↓
HTTP Request: GET res.php?action=getbalance
    ↓
IF: balance < 5
    ↓
Slack / Email: "CaptchaAI balance low: $X.XX"

n8n vs Zapier for CAPTCHA solving

Feature n8n Zapier
Loop/retry support Native (IF loops, Loop node) Limited (Paths only)
Self-hosted option Yes (free) No (cloud only)
Code nodes Full JavaScript Limited
Cost Free (self-hosted) or paid cloud Paid (per task)
Ease of setup Moderate Easy

n8n is better for CAPTCHA workflows because of its loop support and Code nodes.


Troubleshooting

Problem Cause Fix
Poll loop runs forever No max iteration limit Add a counter variable, break after 24 iterations
CAPCHA_NOT_READY nonstop Wait time too short before first poll Increase initial wait to 15-20 seconds
Token not available in next node Wrong expression path Check {{ $json.token }} matches the output
Credentials not found Environment variable not set Restart n8n after setting env vars

FAQ

Can I process multiple CAPTCHAs in one workflow?

Yes. Use the Split In Batches node to process multiple items, each with its own submit → poll → use flow.

Does n8n support Turnstile?

Yes. Change method to turnstile and use sitekey instead of googlekey.


Build CAPTCHA solving into your n8n workflows

Get your API key at captchaai.com.


Discussions (0)

No comments yet.

Related Posts

Tutorials Zapier + CaptchaAI: No-Code CAPTCHA Solving Automation
Integrate Captcha AI with Zapier to solve CAPTCHAs in no-code workflows using Webhooks by Zapier and the Captcha AI API.

Integrate Captcha AI with Zapier to solve CAPTCHAs in no-code workflows using Webhooks by Zapier and the Captc...

Automation reCAPTCHA v2 Image OCR
Jan 18, 2026
Use Cases Government Portal Automation with CAPTCHA Solving
Automate government portal interactions (visa applications, permit filings, records requests) with Captcha AI handling CAPTCHA challenges.

Automate government portal interactions (visa applications, permit filings, records requests) with Captcha AI...

Automation Python reCAPTCHA v2
Jan 30, 2026
Tutorials CAPTCHA Solving Fallback Chains
Implement fallback chains for CAPTCHA solving with Captcha AI.

Implement fallback chains for CAPTCHA solving with Captcha AI. Cascade through solver methods, proxy pools, an...

Automation Python reCAPTCHA v2
Apr 06, 2026
API Tutorials CaptchaAI API Latency Optimization: Faster Solves
Reduce CAPTCHA solve latency with Captcha AI by optimizing poll intervals, connection pooling, prefetching, and proxy selection.

Reduce CAPTCHA solve latency with Captcha AI by optimizing poll intervals, connection pooling, prefetching, an...

Automation Python reCAPTCHA v2
Feb 27, 2026
API Tutorials Building a Python Wrapper Library for CaptchaAI API
Build a reusable Python wrapper library for the Captcha AI API with type hints, retry logic, context managers, and support for CAPTCHA types.

Build a reusable Python wrapper library for the Captcha AI API with type hints, retry logic, context managers,...

Automation Python reCAPTCHA v2
Jan 31, 2026
API Tutorials Solving CAPTCHAs with Swift and CaptchaAI API
Complete guide to solving re CAPTCHA, Turnstile, and image CAPTCHAs in Swift using Captcha AI's HTTP API with URLSession, async/await, and Alamofire.

Complete guide to solving re CAPTCHA, Turnstile, and image CAPTCHAs in Swift using Captcha AI's HTTP API with...

Automation reCAPTCHA v2 Cloudflare Turnstile
Apr 05, 2026
API Tutorials Solving CAPTCHAs with Kotlin and CaptchaAI API
Complete guide to solving re CAPTCHA, Turnstile, and image CAPTCHAs in Kotlin using Captcha AI's HTTP API with Ok Http, Ktor client, and coroutines.

Complete guide to solving re CAPTCHA, Turnstile, and image CAPTCHAs in Kotlin using Captcha AI's HTTP API with...

Automation reCAPTCHA v2 Cloudflare Turnstile
Mar 06, 2026
API Tutorials Solving CAPTCHAs with Ruby and CaptchaAI API
Complete guide to solving re CAPTCHA, Turnstile, and image CAPTCHAs in Ruby using Captcha AI's HTTP API with net/http, Faraday, and HTTParty.

Complete guide to solving re CAPTCHA, Turnstile, and image CAPTCHAs in Ruby using Captcha AI's HTTP API with n...

Automation reCAPTCHA v2 Cloudflare Turnstile
Mar 17, 2026
Use Cases Insurance Quote Comparison Automation with CAPTCHA Handling
Automate insurance quote comparison across carriers with Captcha AI handling re CAPTCHA and image challenges on quote forms.

Automate insurance quote comparison across carriers with Captcha AI handling re CAPTCHA and image challenges o...

Automation Python reCAPTCHA v2
Feb 28, 2026
API Tutorials Solving CAPTCHAs with Scala and CaptchaAI API
Complete guide to solving re CAPTCHA, Turnstile, and image CAPTCHAs in Scala using Captcha AI's HTTP API with sttp, Akka HTTP, and Scala Futures.

Complete guide to solving re CAPTCHA, Turnstile, and image CAPTCHAs in Scala using Captcha AI's HTTP API with...

Automation reCAPTCHA v2 Cloudflare Turnstile
Feb 08, 2026
Tutorials Pytest Fixtures for CaptchaAI API Testing
Build reusable pytest fixtures to test CAPTCHA-solving workflows with Captcha AI.

Build reusable pytest fixtures to test CAPTCHA-solving workflows with Captcha AI. Covers mocking, live integra...

Automation Python reCAPTCHA v2
Apr 08, 2026
Tutorials Using Fiddler to Inspect CaptchaAI API Traffic
How to use Fiddler Everywhere and Fiddler Classic to capture, inspect, and debug Captcha AI API requests and responses — filters, breakpoints, and replay for tr...

How to use Fiddler Everywhere and Fiddler Classic to capture, inspect, and debug Captcha AI API requests and r...

Automation Python All CAPTCHA Types
Mar 05, 2026