Source:
ticket-enricherEnrichment. Your code then decides: reply to the customer, open
an engineering issue, or route to a human, with an internal note either way.
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
REPO in src/handle.ts to a repository connected to your Devin organization, then:
Deploying
One long-lived process that answers202 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.
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.

