Skip to content

feat(automations): cancel an automation run - #1203

Merged
NicolasLopes7 merged 2 commits into
canaryfrom
feat/cancel-automation-run
Nov 18, 2026
Merged

NicolasLopes7 merged 2 commits into
canaryfrom
feat/cancel-automation-run

Conversation

@NicolasLopes7

@NicolasLopes7 NicolasLopes7 commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

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 calls POST /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.

const { data, error } = await resend.automations.runs.cancel({
  automationId: 'c9b16d4f-ba6c-4e2e-b044-6bf4404e57fd',
  runId: '5a1f2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d',
});

Verification

pnpm lint, pnpm typecheck and pnpm vitest run src/automation-runs pass (8 tests, 2 new).

@pkg-pr-new

pkg-pr-new Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/resend@1203

commit: 99e3980

@klotty klotty left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@klotty klotty left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 dielduarte left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@NicolasLopes7

Copy link
Copy Markdown
Contributor Author

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!

@NicolasLopes7
NicolasLopes7 merged commit 2492001 into canary Nov 18, 2026
12 checks passed
@NicolasLopes7
NicolasLopes7 deleted the feat/cancel-automation-run branch November 18, 2026 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants