Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
9031c02
Core: require specifying runId when writing to stream
VaguelySerious Nov 5, 2025
69ae717
Changeset
VaguelySerious Nov 5, 2025
f9be1b6
Fix streamer URL
VaguelySerious Nov 5, 2025
69ba8e6
Add "use client" directive on top-level exports (node16 nextjs support)
VaguelySerious Nov 5, 2025
1399d4b
Revert "Add "use client" directive on top-level exports (node16 nextj…
VaguelySerious Nov 5, 2025
e4b21ff
Add "use client" directive on top-level exports (node16 nextjs support)
VaguelySerious Nov 5, 2025
d6e92a2
Merge branch 'peter/compat-nextjs-prev' into peter/stream-run-id
VaguelySerious Nov 5, 2025
091a24b
Fix: Stream operations during workflow argument serialization use a p…
vercel[bot] Nov 5, 2025
8f8ea13
Fix via Vade
vercel[bot] Nov 5, 2025
035876e
Merge branch 'main' into peter/stream-run-id
VaguelySerious Nov 6, 2025
684cb73
runId only required for writing to streams
VaguelySerious Nov 6, 2025
7e6d081
Fixes
VaguelySerious Nov 6, 2025
fb783b9
Merge branch 'main' into peter/stream-run-id
VaguelySerious Nov 6, 2025
7d07afc
Merge branch 'main' into peter/stream-run-id
VaguelySerious Nov 7, 2025
a67edb5
Fix unit tests
VaguelySerious Nov 7, 2025
7935f4e
Fix unit tests
VaguelySerious Nov 7, 2025
09aeb0b
Merge branch 'main' into peter/stream-run-id
VaguelySerious Nov 7, 2025
1a38950
Merge branch 'main' into peter/stream-run-id
VaguelySerious Nov 7, 2025
c59cca3
Merge branch 'main' into peter/stream-run-id
VaguelySerious Nov 7, 2025
205c22f
Might as well try
VaguelySerious Nov 7, 2025
2d4dbdc
Merge branch 'main' into peter/stream-run-id
VaguelySerious Nov 8, 2025
6708473
Merge branch 'main' into peter/stream-run-id
VaguelySerious Nov 10, 2025
f6ca5ae
Merge branch 'main' into peter/stream-run-id
VaguelySerious Nov 10, 2025
0fe0303
Forward compat
VaguelySerious Nov 10, 2025
6edcd56
Merge branch 'main' into peter/stream-run-id
VaguelySerious Nov 11, 2025
fd4449c
test
VaguelySerious Nov 11, 2025
c58e431
Merge branch 'main' into peter/stream-run-id
VaguelySerious Nov 11, 2025
de32083
Revert "test"
VaguelySerious Nov 11, 2025
58e4247
Fix
VaguelySerious Nov 11, 2025
79ea6d5
Merge branch 'main' into peter/stream-run-id
VaguelySerious Nov 12, 2025
5b83acc
Fix test
VaguelySerious Nov 12, 2025
598ee12
Revert "Fix"
VaguelySerious Nov 12, 2025
6f00b3d
Use test deployment
VaguelySerious Nov 12, 2025
2046501
Merge branch 'peter/stream-run-id' into peter/test-api-90
VaguelySerious Nov 12, 2025
0d1eef2
New test
VaguelySerious Nov 12, 2025
ec58064
Merge branch 'main' into peter/test-api-90
VaguelySerious Nov 12, 2025
bad4cf0
Merge branch 'main' into peter/test-api-90
VaguelySerious Dec 1, 2025
00a455d
Update url
VaguelySerious Dec 1, 2025
08e3995
Reset
VaguelySerious Dec 1, 2025
137d105
WIP
VaguelySerious Dec 1, 2025
173371b
Merge branch 'main' into peter/test-api-90
VaguelySerious Dec 5, 2025
dae5f6a
Merge branch 'main' into peter/test-api-90
VaguelySerious Dec 5, 2025
2faeb94
New url
VaguelySerious Dec 5, 2025
47b1cd6
Merge branch 'main' into peter/test-api-90
VaguelySerious Dec 10, 2025
6393bc8
Update
VaguelySerious Dec 10, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
104 changes: 1 addition & 103 deletions packages/core/e2e/e2e.test.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
import { withResolvers } from '@workflow/utils';
import { assert, afterAll, describe, expect, test } from 'vitest';
import { dehydrateWorkflowArguments } from '../src/serialization';
import {
cliInspectJson,
getProtectionBypassHeaders,
isLocalDeployment,
} from './utils';
import { getProtectionBypassHeaders, isLocalDeployment } from './utils';
import fs from 'fs';
import path from 'path';

Expand Down Expand Up @@ -145,22 +141,6 @@ describe('e2e', () => {
const run = await triggerWorkflow(workflow, [123]);
const returnValue = await getWorkflowReturnValue(run.runId);
expect(returnValue).toBe(133);

const { json } = await cliInspectJson(`runs ${run.runId} --withData`);
expect(json).toMatchObject({
runId: run.runId,
workflowName: expect.any(String),
status: 'completed',
input: [123],
output: 133,
});
// In local vs. vercel backends, the workflow name is different, so we check for either,
// since this test runs against both. Also different workbenches have different directory structures.
expect(json.workflowName).toBeOneOf([
`workflow//example/${workflow.workflowFile}//${workflow.workflowFn}`,
`workflow//${workflow.workflowFile}//${workflow.workflowFn}`,
`workflow//src/${workflow.workflowFile}//${workflow.workflowFn}`,
]);
});

const isNext = process.env.APP_NAME?.includes('nextjs');
Expand Down Expand Up @@ -591,33 +571,6 @@ describe('e2e', () => {

// The step should have succeeded on attempt 3
expect(returnValue).toEqual({ finalAttempt: 3 });

// Also verify the run data shows the correct output
const { json: runData } = await cliInspectJson(
`runs ${run.runId} --withData`
);
expect(runData).toMatchObject({
runId: run.runId,
status: 'completed',
output: { finalAttempt: 3 },
});

// Query steps separately to verify the step data
const { json: stepsData } = await cliInspectJson(
`steps --runId ${run.runId} --withData`
);
expect(stepsData).toBeDefined();
expect(Array.isArray(stepsData)).toBe(true);
expect(stepsData.length).toBeGreaterThan(0);

// Find the stepThatRetriesAndSucceeds step
const retryStep = stepsData.find((s: any) =>
s.stepName.includes('stepThatRetriesAndSucceeds')
);
expect(retryStep).toBeDefined();
expect(retryStep.status).toBe('completed');
expect(retryStep.attempt).toBe(3);
expect(retryStep.output).toEqual([3]);
});

test('retryableAndFatalErrorWorkflow', { timeout: 60_000 }, async () => {
Expand Down Expand Up @@ -709,14 +662,6 @@ describe('e2e', () => {

// Stack trace should NOT contain 'evalmachine' anywhere
expect(returnValue.cause.stack).not.toContain('evalmachine');

// Verify the run failed with structured error
const { json: runData } = await cliInspectJson(`runs ${run.runId}`);
expect(runData.status).toBe('failed');
expect(runData.error).toBeTypeOf('object');
expect(runData.error.message).toContain(
'Error from imported helper module'
);
}
);

Expand Down Expand Up @@ -789,13 +734,6 @@ describe('e2e', () => {
customData,
hookCleanupTestData: 'workflow_completed',
});

// Verify both runs completed successfully
const { json: run1Data } = await cliInspectJson(`runs ${run1.runId}`);
expect(run1Data.status).toBe('completed');

const { json: run2Data } = await cliInspectJson(`runs ${run2.runId}`);
expect(run2Data.status).toBe('completed');
}
);

Expand All @@ -810,24 +748,6 @@ describe('e2e', () => {

// doubleNumber(10) = 20, then multiply by 2 = 40
expect(returnValue).toBe(40);

// Verify the run completed successfully
const { json: runData } = await cliInspectJson(
`runs ${run.runId} --withData`
);
expect(runData.status).toBe('completed');
expect(runData.output).toBe(40);

// Verify that exactly 2 steps were executed:
// 1. stepWithStepFunctionArg(doubleNumber)
// (doubleNumber(10) is run inside the stepWithStepFunctionArg step)
const { json: eventsData } = await cliInspectJson(
`events --run ${run.runId} --json`
);
const stepCompletedEvents = eventsData.filter(
(event) => event.eventType === 'step_completed'
);
expect(stepCompletedEvents).toHaveLength(1);
}
);

Expand All @@ -846,13 +766,6 @@ describe('e2e', () => {
// - 7 * 3 = 21, prefixed with "Result: " = "Result: 21"
// - stepThatCallsStepFn wraps it: "Wrapped: Result: 21"
expect(returnValue).toBe('Wrapped: Result: 21');

// Verify the run completed successfully
const { json: runData } = await cliInspectJson(
`runs ${run.runId} --withData`
);
expect(runData.status).toBe('completed');
expect(runData.output).toBe('Wrapped: Result: 21');
}
);

Expand Down Expand Up @@ -897,21 +810,6 @@ describe('e2e', () => {
childResult: inputValue * 2, // doubleValue(42) = 84
originalValue: inputValue,
});

// Verify both runs completed successfully via CLI
const { json: parentRunData } = await cliInspectJson(
`runs ${run.runId} --withData`
);
expect(parentRunData.status).toBe('completed');

const { json: childRunData } = await cliInspectJson(
`runs ${returnValue.childRunId} --withData`
);
expect(childRunData.status).toBe('completed');
expect(childRunData.output).toEqual({
childResult: inputValue * 2,
originalValue: inputValue,
});
}
);
});
3 changes: 2 additions & 1 deletion packages/world-vercel/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ export const getHttpUrl = (
config?: APIConfig
): { baseUrl: string; usingProxy: boolean } => {
const projectConfig = config?.projectConfig;
const defaultUrl = 'https://vercel-workflow.com/api';
const defaultUrl =
'https://workflow-server-git-peter-redis-switchover.vercel.sh/api';
const defaultProxyUrl = 'https://api.vercel.com/v1/workflow';
const usingProxy = Boolean(
config?.baseUrl || (projectConfig?.projectId && projectConfig?.teamId)
Expand Down
Loading