Repository navigation
feat(automations): cancel an automation run - #1203
Conversation
Co-Authored-By: Claude Opus 5.5 <[email protected]>
commit: |
klotty
left a comment
There was a problem hiding this comment.
No issues found across 4 files
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Auto-approved: Adds a cancel method to the automation runs SDK that POSTs to the cancel endpoint, with typed options/response interfaces and two tests. The change is additive, follows existing SDK patterns, and does not alter existing behavior or operational settings.
View guided diff | Re-trigger cubic
Co-Authored-By: Claude Opus 5.5 <[email protected]>
klotty
left a comment
There was a problem hiding this comment.
0 issues found across 1 file (changes from recent commits).
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Auto-approved: Adds an SDK method to cancel an automation run via the existing cancel endpoint, with typed interfaces and tests; the change is additive and does not alter existing behavior or operational settings.
View guided diff | Re-trigger cubic
dielduarte
left a comment
There was a problem hiding this comment.
nicee! just a heads up, we usually merge open api spec first before releasing the sdks, I see you have a PR opened adding the spec there.
merged! |
Why
Customers can now cancel a single automation run from the dashboard. This adds the same action to the SDK so they can do it from code, and so the MCP servers can expose it.
What
Adds
resend.automations.runs.cancel({ automationId, runId }), which callsPOST /automations/{automation_id}/runs/{run_id}/cancel. It returns{ object: 'automation_run', id, status: 'cancelled' }.The API returns 404 when the automation or run doesn't exist, and 422 when the run has already finished. Cancelling a run that's already cancelled succeeds.
Verification
pnpm lint,pnpm typecheckandpnpm vitest run src/automation-runspass (8 tests, 2 new).