Skip to main content
A ticket arrives, Devin reads your product’s source and runs whatever read-only checks settle the question, and hands back a typed Enrichment. Your code then decides: reply to the customer, open an engineering issue, or route to a human, with an internal note either way.
What makes this a Devin example rather than a prompt: the answer needs a machine. “Do you retry webhooks on a 5xx?” is answered by finding the delivery code and reading the retry policy out of it. The reply cites files, and confidence is low when the code did not settle the question, which decide turns into “assign a human”.

Where Devin runs

In the cloud: createSession({ repos: [REPO] }) starts a session with that repository checked out on Devin’s machine, so this process never sees the code. The permission handler rejects requests identified as edits, deletes or moves, and the prompt asks for an investigation without changes; it is not a read-only sandbox, so a session can still run tests and reproduction commands there. The example does not use local mode on purpose: a webhook you deploy has no checkout to point at.

Run

Set REPO in src/handle.ts to a repository connected to your Devin organization, then:

Deploying

One long-lived process that answers 202 in milliseconds and keeps working for a few minutes: any host that runs a container and keeps it up. It needs two secrets (DEVIN_API_KEY, WEBHOOK_SECRET), a shutdown grace period of a few minutes so in-flight tickets finish on SIGTERM, and nothing else; the image omits the CLI binaries because Devin does the work in its own sandbox.
It does not run as written on serverless platforms, where a function is frozen once it responds; put a queue in front and run handle() from a worker. The README covers adapting it to your help desk’s payload and signature scheme, your rules, and bursts.

Launch and structured output

run(prompt, {output}), the schema-as-contract pattern this example is built on.

Anthropic agent patterns

The same typed-output idea across five workflow shapes, without a webhook around it.