Hybrid Worker
A hybrid deployment allows you to execute tools in your own environment while still leveraging Arcade’s cloud Gateway infrastructure. This gives you the flexibility to access private resources, maintain data security, and customize your worker environment while leveraging Arcade’s gateway and management capabilities.
How hybrid workers work
The hybrid worker model uses a bidirectional connection between your local environment and Arcade’s cloud gateway:
- You run the Arcade worker in your environment (on-premises, private cloud, etc.)
- Your worker is exposed to Arcade’s cloud gateway using a public URL
- The Arcade cloud gateway routes tool calls to your worker
- Your worker processes the requests and returns responses to the gateway
Benefits of hybrid workers
- Resource access: Access private databases, APIs, or other resources not accessible from Arcade’s cloud
- Data control: Keep sensitive data within your environment while still using Arcade’s capabilities
- Custom environments: Use specific dependencies or configurations required by your tools
- Compliance: Meet regulatory requirements by keeping data processing within your infrastructure
Setting up a hybrid worker
Setup your toolkits
Follow the Creating a Toolkit guide to create your toolkits.
Alternatively, you can install an Arcade Toolkit:
pip install arcade-math
Start your local worker
Run your Arcade worker locally with a secret that you generate in some secure way:
export ARCADE_WORKER_SECRET=your-secret
arcade serve
Verify your worker is running by visiting http://localhost:8002/worker/health.
Create a public URL
To allow the Arcade cloud gateway to connect to your locally running worker, you need a public URL. Here are a few options:
ngrok http 8002
Register your worker in Arcade
- Navigate to the Workers page in your Arcade dashboard
- Click Add Worker
- Fill in the form:
- ID: Choose a unique identifier (e.g.,
my-hybrid-worker
) - Worker Type: Select
Arcade
- URL: Enter your public URL from Step 3
- Secret: Enter the secret for your worker (or use
dev
for testing) - Timeout and Retry: Configure as needed for your use case
- ID: Choose a unique identifier (e.g.,
- Click Create
Test the connection to your worker
You can now test your worker by making requests through the Arcade API or using the Playground:
- Go to the Playground
- Select a tool from your toolkit and execute it
- Verify that the response is correct and you see request logs in your worker
Best practices
- Persistent URLs: For production use, set up a persistent public URL rather than ephemeral ones
- TLS: Use a TLS-enabled URL for production use
- Security: Use strong secrets for worker authentication
- Monitoring: Set up monitoring for your hybrid workers to ensure availability
- Scaling: For high-load scenarios, consider running multiple workers behind a load balancer
Troubleshooting
- Connection issues: Ensure your public URL is accessible and that your local worker is running
- Authentication failures: Verify that the worker secret matches what’s configured in the Arcade dashboard
- Timeout errors: If your worker takes too long to respond, increase the timeout value in the worker configuration
Next steps
- Create custom tools for your hybrid worker
- Set up authentication for secure access to resources
- Configure secrets for your worker