feat: implement automations and events APIs#197
Merged
Conversation
Introduces two new resource namespaces: - Automations: create, get, list, update, remove, stop, list_runs, get_run - Events: create, get, list, update, remove, send Each method has a sync and async (_async) variant. Both resources are registered on the main resend client and fully exported from the package. Includes tests (sync + async) for every method and examples covering all documented step types — delay with duration string, wait_for_event with timeout string, and send_email with template object. Field names verified against resend/resend-openapi main: - Step identifier: key (not ref) - Connections array: connections (not edges) - Connection type field: type (not edge_type) - Send email config: template.id (not template_id) - PATCH body strips path params (automation_id, identifier) before sending
…lass Mirror the Node SDK pattern where runs are accessed via a nested namespace: resend.Automations.Runs.list(id) / resend.Automations.Runs.get(id, run_id)
Contributor
There was a problem hiding this comment.
1 issue found across 15 files
Confidence score: 3/5
- There is a concrete runtime risk in
resend/automations/_automations.py:except ImportError: passcan leaveAsyncRequestundefined, which may trigger aNameErrorwhen async automation APIs are used without async extras installed. - I’m scoring this as moderate merge risk because the impact is user-facing for a specific configuration path (async usage), even though it is not a universal failure path for all users.
- Pay close attention to
resend/automations/_automations.py- missing async dependency handling can surface as runtime errors instead of a controlled fallback.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="resend/automations/_automations.py">
<violation number="1" location="resend/automations/_automations.py:23">
P2: The `except ImportError: pass` leaves `AsyncRequest` undefined, causing runtime `NameError` when any async API is called without async extras installed.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
zenorocha
approved these changes
Apr 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary by cubic
Adds Automations and Events APIs with full sync and async support, including examples and tests. Introduces
resend.Automationsandresend.Eventsnamespaces and mirrors the Node SDK runs pattern.New Features
resend.Automations: create/get/list/update/remove/stop; runs viaAutomations.Runs.list(id)andAutomations.Runs.get(id, run_id); sync and_asyncvariants.resend.Events: create/get/list/update/remove/send; sync and_asyncvariants.Automation*,Event*) and resources registered on the mainresendclient.delay(duration string),wait_for_event(timeout string), andsend_emailwithtemplate.id.Refactors
Automations.Runsfor parity with the Node SDK.key,connections,type,template.id.run_stepto satisfy mypy.Written for commit b4b83f2. Summary will update on new commits.