Run Devin agents ↗ on Cloudflare. Each Devin session runs in its own isolated sandbox backed by Cloudflare Containers.
You need:
- A Devin Enterprise organization with permission to manage outposts and service users
- A Cloudflare account with access to Workers, Containers, and R2
- For manual deployment, Node.js 24 ↗ and a running Docker ↗ daemon
-
Open your Devin organization outpost settings. Replace both instances of
my-orgin this URL with your organization slug:https://my-org.devinenterprise.com/org/my-org/settings/enterprise-environment?tab=outposts -
Create or select an outpost. Copy its outpost ID for
DEVIN_OUTPOST_IDand its token forDEVIN_API_TOKEN.
For more information about outposts, refer to the Devin Outposts overview ↗.
The fastest setup uses the Deploy to Cloudflare button. The deployment flow prompts for your Devin Outpost ID and API token. It also creates and configures the required containers.
Enter these credentials when prompted:
| Variable | Value |
|---|---|
DEVIN_OUTPOST_ID |
Your Devin Outpost ID |
DEVIN_API_TOKEN |
A Devin service-user token with the Run outpost workers permission |
After the deployment finishes, your outpost is ready to run Devin sessions on Cloudflare by selecting it from the Virtual environment menu.
Use the following procedure when you need to add dependencies, tools, or environment variables to the template.
-
Create a project from the Devin Outpost template:
npm create cloudflare@latest -- cloudflare-devin-outpost --template=cloudflare/sandbox-sdk/devinyarn create cloudflare cloudflare-devin-outpost --template=cloudflare/sandbox-sdk/devinpnpm create cloudflare@latest cloudflare-devin-outpost --template=cloudflare/sandbox-sdk/devin -
Go to the project directory and log in to your Cloudflare account:
cd cloudflare-devin-outpost npx wrangler login -
Create the R2 bucket for session checkpoints:
npx wrangler r2 bucket create devin-outpost-stateTo use another bucket name, update
bucket_nameinwrangler.jsonc. -
In
wrangler.jsonc, replace the emptyDEVIN_OUTPOST_IDvalue with your outpost ID.The default
DEVIN_API_URLishttps://api.devin.ai/opbeta. Change this value only if your Devin environment uses another API URL. -
Store your Devin API token as a Worker secret:
npx wrangler secret put DEVIN_API_TOKENEnter your service-user token when Wrangler prompts you. Do not add the token to
wrangler.jsonc. -
Deploy the worker and container:
npm run deployWrangler builds the container and deploys the worker, container application, and cron trigger.
-
Verify the deployment with the worker URL from the Wrangler output:
curl https://<YOUR_WORKER>.workers.dev/The worker returns:
{ "service": "devin-outpost", "status": "ok" }
In Devin, create a session and select your outpost from the Virtual environment menu. The worker polls Devin once per minute, so you may need to wait up to one minute for the session container to start.
The template manages the lifecycle of each Devin session:
- Poll: A cron trigger runs once per minute. The worker checks the current session statuses for your Devin Outpost.
- Start: Each pending or running session receives its own container. The container runs the official Devin worker command.
- Suspend: When a session suspends, the container archives
/root,/workspace, and/opt/devin-persistentto R2. The container restores the checkpoint when the session resumes. - Terminate: When a session terminates, the worker removes its container and R2 checkpoint.
The worker coordinates the containers. Devin continues to manage session assignment and the session runtime.