Installation issues
Node.js version error
Node.js version error
Refrain requires Node.js 18 or later. Check your version:If it’s below 18, update Node.js using nvm, fnm, or download from nodejs.org.
Permission error during global install
Permission error during global install
If
npm install -g fails with permission errors, either:- Use
npx @refrainai/cliinstead (no global install needed) - Fix npm permissions: npm docs
Browser binary not found
Browser binary not found
Refrain bundles a Chromium binary automatically. If it’s not found, try reinstalling:If behind a corporate proxy, ensure the proxy allows downloading from Playwright’s CDN.
AI provider issues
'API key not set' error
'API key not set' error
Ensure the appropriate environment variable is exported for your provider:See AI Provider Setup for all provider variables.
Rate limit errors (429)
Rate limit errors (429)
You’ve hit the provider’s rate limit. Options:
- Wait and retry — Refrain automatically retries with exponential backoff
- Use a different model or provider
- Contact your AI provider to increase limits
Model ID not found
Model ID not found
Double-check the model ID matches your provider. Common examples:
- Anthropic:
claude-sonnet-4-6 - OpenAI:
gpt-4o - Google:
gemini-2.5-pro - Bedrock:
anthropic.claude-sonnet-4-6-v1:0 - Vertex:
claude-sonnet-4-6@20250514
Generation issues
AI gets stuck or goes in circles
AI gets stuck or goes in circles
- Press Enter to pause and provide guidance
- Add more detail to
context.mdabout the target page - Try a more specific
--goal - Increase
--max-iterationsif the workflow is long
AI explores the wrong pages
AI explores the wrong pages
Add navigation hints to
context.md:Goal not achieved
Goal not achieved
Check the generated report for details on where AI stopped. Common causes:
- Insufficient context — add more detail to
context.md - Bot detection — try
--stealthmode - Complex multi-step workflow — break into smaller goals
Bot detection blocking the browser
Bot detection blocking the browser
Use stealth mode to apply anti-detection patches:Some sites may also require
--proxy to route through a residential proxy.Execution issues
Selector resolution fails
Selector resolution fails
The UI may have changed since the runbook was generated. Options:
- Run with
--self-healto get AI repair suggestions - Run with
--headless falseto see what the page looks like - Use
--screenshotsto capture the page state at each step
Variables not being resolved
Variables not being resolved
Check the variable’s
source type:prompt— asks interactively at the CLIenv— reads from environment variables (ensure they’re exported)context— requires a--contextfilefixed— the value should be in the runbook definitionsecrets— requires a--secretsfile
Timeout errors
Timeout errors
The page may be slow to load. Options:
- Increase
--step-delayto give pages more time between steps - Add a
waitstep in the runbook before the failing step - Check network connectivity to the target site
Download files not appearing
Download files not appearing
Ensure The directory is created automatically if it doesn’t exist.
--output-dir is set:Approval & notification issues
Slack buttons show 'This didn't work'
Slack buttons show 'This didn't work'
Approval times out
Approval times out
The callback is not reaching the executor. Verify that the callback endpoint is accessible from the internet and the Slack App’s Request URL is correctly configured.
'not_in_channel' error
'not_in_channel' error
The bot hasn’t been invited to the Slack channel. Run
/invite @your-bot-name in the target channel.Debugging tools
When troubleshooting, these flags are your best friends:| Flag | What it does |
|---|---|
--headless false | Show the browser window to see what’s happening |
--screenshots <dir> | Save a screenshot after each step |
--report | Generate a detailed Markdown execution report |
--debug | Print debug output to the console |
Getting help
- CLI Reference — All commands and options
- YAML Reference — Runbook schema documentation
- Plans & Pricing — Feature availability by plan