Skip to content

feat: preview workflows#866

Open
felipefreitag wants to merge 17 commits intocanaryfrom
preview-workflows
Open

feat: preview workflows#866
felipefreitag wants to merge 17 commits intocanaryfrom
preview-workflows

Conversation

@felipefreitag
Copy link

No description provided.

@felipefreitag felipefreitag requested a review from a team as a code owner March 4, 2026 17:13
@felipefreitag felipefreitag requested a review from vcapretz March 4, 2026 17:13
@pkg-pr-new
Copy link

pkg-pr-new bot commented Mar 4, 2026

Open in StackBlitz

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

commit: 8761da8

@felipefreitag felipefreitag changed the title feat: Preview workflows feat: preview workflows Mar 4, 2026
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

4 issues found across 25 files

Confidence score: 3/5

  • There’s some meaningful merge risk: src/events/events.spec.ts adds new Resend Events/workflow SDK operations without explicit confirmation of required production API-key permissions, which can lead to authorization failures or policy non-compliance after release.
  • src/workflows/workflows.spec.ts and src/events/events.spec.ts include API-key-like hardcoded token strings in tests; even in test artifacts, this is a security hygiene concern and should be replaced with redacted placeholders before merging.
  • In src/events/events.spec.ts, a test retrieves data without asserting it, so regressions in events.get response handling may slip through undetected.
  • Pay close attention to src/events/events.spec.ts and src/workflows/workflows.spec.ts - permission-check compliance and token redaction need to be resolved to reduce risk.
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="src/events/events.spec.ts">

<violation number="1" location="src/events/events.spec.ts:15">
P2: Avoid committing raw API tokens in tests; use a redacted placeholder value instead.

(Based on your team's feedback about redacting secrets from test artifacts.) [FEEDBACK_USED]</violation>

<violation number="2" location="src/events/events.spec.ts:131">
P1: Custom agent: **API Key Permission Check SDK Methods**

Rule 1 (API Key Permission Check SDK Methods) is violated: this PR introduces new Resend Events/workflow SDK operations without an explicit confirmation that production API keys have the required permissions for these endpoints. Add a permission-scope verification note/check before release to avoid runtime authorization failures.</violation>

<violation number="3" location="src/events/events.spec.ts:257">
P2: The test fetches `data` but never asserts it, so regressions in `events.get` response handling can pass unnoticed.</violation>
</file>

<file name="src/workflows/workflows.spec.ts">

<violation number="1" location="src/workflows/workflows.spec.ts:17">
P2: Do not commit API-key-like secrets in test code; replace hardcoded token strings with a redacted dummy/test value.

(Based on your team's feedback about redacting secrets from test artifacts.) [FEEDBACK_USED]</violation>
</file>

Since this is your first cubic review, here's how it works:

  • cubic automatically reviews your code and comments on bugs and improvements
  • Teach cubic by replying to its comments. cubic learns from your replies and gets better over time
  • Add one-off context when rerunning by tagging @cubic-dev-ai with guidance or docs links (including llms.txt)
  • Ask questions if you need clarification on any suggestion

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

},
});

const data = await resend.events.create({
Copy link
Contributor

Choose a reason for hiding this comment

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

P1: Custom agent: API Key Permission Check SDK Methods

Rule 1 (API Key Permission Check SDK Methods) is violated: this PR introduces new Resend Events/workflow SDK operations without an explicit confirmation that production API keys have the required permissions for these endpoints. Add a permission-scope verification note/check before release to avoid runtime authorization failures.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/events/events.spec.ts, line 131:

<comment>Rule 1 (API Key Permission Check SDK Methods) is violated: this PR introduces new Resend Events/workflow SDK operations without an explicit confirmation that production API keys have the required permissions for these endpoints. Add a permission-scope verification note/check before release to avoid runtime authorization failures.</comment>

<file context>
@@ -0,0 +1,421 @@
+        },
+      });
+
+      const data = await resend.events.create({
+        name: 'user.created',
+        schema: { name: 'string', age: 'number' },
</file context>

const fetchMocker = createFetchMock(vi);
fetchMocker.enableMocks();

const resend = new Resend('re_zKa4RCko_Lhm9ost2YjNCctnPjbLw8Nop');
Copy link
Contributor

Choose a reason for hiding this comment

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

P2: Do not commit API-key-like secrets in test code; replace hardcoded token strings with a redacted dummy/test value.

(Based on your team's feedback about redacting secrets from test artifacts.)

View Feedback

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/workflows/workflows.spec.ts, line 17:

<comment>Do not commit API-key-like secrets in test code; replace hardcoded token strings with a redacted dummy/test value.

(Based on your team's feedback about redacting secrets from test artifacts.) </comment>

<file context>
@@ -0,0 +1,409 @@
+const fetchMocker = createFetchMock(vi);
+fetchMocker.enableMocks();
+
+const resend = new Resend('re_zKa4RCko_Lhm9ost2YjNCctnPjbLw8Nop');
+
+describe('Workflows', () => {
</file context>

const fetchMocker = createFetchMock(vi);
fetchMocker.enableMocks();

const resend = new Resend('re_zKa4RCko_Lhm9ost2YjNCctnPjbLw8Nop');
Copy link
Contributor

Choose a reason for hiding this comment

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

P2: Avoid committing raw API tokens in tests; use a redacted placeholder value instead.

(Based on your team's feedback about redacting secrets from test artifacts.)

View Feedback

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/events/events.spec.ts, line 15:

<comment>Avoid committing raw API tokens in tests; use a redacted placeholder value instead.

(Based on your team's feedback about redacting secrets from test artifacts.) </comment>

<file context>
@@ -0,0 +1,421 @@
+const fetchMocker = createFetchMock(vi);
+fetchMocker.enableMocks();
+
+const resend = new Resend('re_zKa4RCko_Lhm9ost2YjNCctnPjbLw8Nop');
+
+describe('Events', () => {
</file context>

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

2 issues found across 8 files (changes from recent commits).

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="src/workflow-runs/workflow-runs.spec.ts">

<violation number="1" location="src/workflow-runs/workflow-runs.spec.ts:41">
P2: Avoid hardcoding token-like API keys in tests; use an obviously redacted/dummy value instead.

(Based on your team's feedback about redacting secrets in test artifacts.) [FEEDBACK_USED]</violation>
</file>

<file name="src/workflow-runs/workflow-runs.ts">

<violation number="1" location="src/workflow-runs/workflow-runs.ts:18">
P1: Custom agent: **API Key Permission Check SDK Methods**

This PR adds new Workflow Runs SDK operations (`get`/`list`) but does not include a permission-check reminder/handling path for API keys. Per the API Key Permission Check SDK Methods rule, confirm production API keys have scopes for these new `/workflows/*/runs` operations to prevent permission-related runtime failures.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

constructor(private readonly resend: Resend) {}

async get(options: GetWorkflowRunOptions): Promise<GetWorkflowRunResponse> {
const data = await this.resend.get<GetWorkflowRunResponseSuccess>(
Copy link
Contributor

Choose a reason for hiding this comment

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

P1: Custom agent: API Key Permission Check SDK Methods

This PR adds new Workflow Runs SDK operations (get/list) but does not include a permission-check reminder/handling path for API keys. Per the API Key Permission Check SDK Methods rule, confirm production API keys have scopes for these new /workflows/*/runs operations to prevent permission-related runtime failures.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/workflow-runs/workflow-runs.ts, line 18:

<comment>This PR adds new Workflow Runs SDK operations (`get`/`list`) but does not include a permission-check reminder/handling path for API keys. Per the API Key Permission Check SDK Methods rule, confirm production API keys have scopes for these new `/workflows/*/runs` operations to prevent permission-related runtime failures.</comment>

<file context>
@@ -0,0 +1,35 @@
+  constructor(private readonly resend: Resend) {}
+
+  async get(options: GetWorkflowRunOptions): Promise<GetWorkflowRunResponse> {
+    const data = await this.resend.get<GetWorkflowRunResponseSuccess>(
+      `/workflows/${options.workflowId}/runs/${options.runId}`,
+    );
</file context>


mockSuccessResponse(response, {});

const resend = new Resend('re_zKa4RCko_Lhm9ost2YjNCctnPjbLw8Nop');
Copy link
Contributor

Choose a reason for hiding this comment

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

P2: Avoid hardcoding token-like API keys in tests; use an obviously redacted/dummy value instead.

(Based on your team's feedback about redacting secrets in test artifacts.)

View Feedback

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/workflow-runs/workflow-runs.spec.ts, line 41:

<comment>Avoid hardcoding token-like API keys in tests; use an obviously redacted/dummy value instead.

(Based on your team's feedback about redacting secrets in test artifacts.) </comment>

<file context>
@@ -0,0 +1,190 @@
+
+      mockSuccessResponse(response, {});
+
+      const resend = new Resend('re_zKa4RCko_Lhm9ost2YjNCctnPjbLw8Nop');
+      await expect(
+        resend.workflows.runs.get(options),
</file context>

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

2 issues found across 10 files (changes from recent commits).

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="src/workflow-run-steps/workflow-run-steps.ts">

<violation number="1" location="src/workflow-run-steps/workflow-run-steps.ts:21">
P1: Custom agent: **API Key Permission Check SDK Methods**

This PR adds new SDK methods that call workflow run step endpoints. Please confirm that the existing production API keys are provisioned with the required permissions for these new workflow run step read operations to avoid permission failures after deployment.</violation>
</file>

<file name="src/workflow-run-steps/workflow-run-steps.spec.ts">

<violation number="1" location="src/workflow-run-steps/workflow-run-steps.spec.ts:46">
P2: Avoid hardcoding API keys in test code; use a redacted placeholder or environment variable to prevent credential leakage.

(Based on your team's feedback about redacting secrets from test recordings/cassettes even if ephemeral.) [FEEDBACK_USED]</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

options: GetWorkflowRunStepOptions,
): Promise<GetWorkflowRunStepResponse> {
const data = await this.resend.get<GetWorkflowRunStepResponseSuccess>(
`/workflows/${options.workflowId}/runs/${options.runId}/steps/${options.stepId}`,
Copy link
Contributor

Choose a reason for hiding this comment

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

P1: Custom agent: API Key Permission Check SDK Methods

This PR adds new SDK methods that call workflow run step endpoints. Please confirm that the existing production API keys are provisioned with the required permissions for these new workflow run step read operations to avoid permission failures after deployment.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/workflow-run-steps/workflow-run-steps.ts, line 21:

<comment>This PR adds new SDK methods that call workflow run step endpoints. Please confirm that the existing production API keys are provisioned with the required permissions for these new workflow run step read operations to avoid permission failures after deployment.</comment>

<file context>
@@ -0,0 +1,38 @@
+    options: GetWorkflowRunStepOptions,
+  ): Promise<GetWorkflowRunStepResponse> {
+    const data = await this.resend.get<GetWorkflowRunStepResponseSuccess>(
+      `/workflows/${options.workflowId}/runs/${options.runId}/steps/${options.stepId}`,
+    );
+    return data;
</file context>


mockSuccessResponse(response, {});

const resend = new Resend('re_zKa4RCko_Lhm9ost2YjNCctnPjbLw8Nop');
Copy link
Contributor

Choose a reason for hiding this comment

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

P2: Avoid hardcoding API keys in test code; use a redacted placeholder or environment variable to prevent credential leakage.

(Based on your team's feedback about redacting secrets from test recordings/cassettes even if ephemeral.)

View Feedback

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/workflow-run-steps/workflow-run-steps.spec.ts, line 46:

<comment>Avoid hardcoding API keys in test code; use a redacted placeholder or environment variable to prevent credential leakage.

(Based on your team's feedback about redacting secrets from test recordings/cassettes even if ephemeral.) </comment>

<file context>
@@ -0,0 +1,207 @@
+
+      mockSuccessResponse(response, {});
+
+      const resend = new Resend('re_zKa4RCko_Lhm9ost2YjNCctnPjbLw8Nop');
+      await expect(
+        resend.workflows.runs.steps.get(options),
</file context>

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 3 files (changes from recent commits).

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="src/workflows/interfaces/workflow-step.interface.ts">

<violation number="1" location="src/workflows/interfaces/workflow-step.interface.ts:82">
P3: `WorkflowStepType` duplicates the literal step-type list already defined by `WorkflowStep`, creating a drift risk. Derive it from `WorkflowStep['type']` to keep a single source of truth.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant