@outputai/core 0.7.1-next.ed233ce.0 → 0.8.1-889977.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/tracing/processors/local/temp/traces/019e84c6-23ee-7590-9b96-3677ef70ff7a.trace +10 -0
- package/src/tracing/processors/local/temp/traces/1781604400044_019ecfe5-bbac-78be-97e7-33dbf80a9a89.trace +3 -0
- package/src/tracing/processors/local/temp/traces/1781604429407_019ecfe6-2e5f-78f0-9bfe-722fdb015368.trace +30 -0
- package/src/tracing/processors/local/temp/traces/1781604429407_ba292f3f-e510-4cf4-9b88-ff71f703bb58.trace +27 -0
- package/src/tracing/processors/local/temp/traces/1781604501861_019ecfe7-4965-7b9a-b079-3a44916a04e6.trace +11 -0
- package/src/tracing/processors/local/temp/traces/1781604501861_049735a9-7a43-4fd5-a66d-de9c13caf5b8.trace +1 -0
- package/src/tracing/processors/local/temp/traces/1781604501861_294d05f8-dc1f-40f3-bc1a-808c9987bca2.trace +1 -0
- package/src/tracing/processors/local/temp/traces/1781724285242_019ed70b-093a-7b81-ab9c-d2b721e0da41.trace +8 -0
- package/src/tracing/processors/local/temp/traces/1781899265052_019ee179-041c-74d3-bbfb-b3486e610779.trace +13 -0
- package/src/worker/configs.js +13 -0
- package/src/worker/configs.spec.js +34 -1
- package/src/worker/connection_monitor.js +2 -13
- package/src/worker/connection_monitor.spec.js +4 -21
- package/src/worker/index.js +7 -2
- package/src/worker/index.spec.js +22 -1
- package/src/worker/interruption.js +2 -2
- package/src/worker/interruption.spec.js +13 -1
- package/src/worker/temp/__activity_options.js +32 -0
- package/src/worker/temp/__workflows_entrypoint.js +54 -0
package/package.json
CHANGED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{"kind":"workflow","action":"start","name":"continue_as_new","id":"019e84c6-23ee-7590-9b96-3677ef70ff7a","timestamp":1780344038411,"details":{"value":1}}
|
|
2
|
+
{"action":"end","id":"1","timestamp":1780344038419,"details":{"local":"/Users/sz/Dev/output/test_workflows/logs/runs/continue_as_new/2026-06-01-20-00-38-382Z_vzcxpyt1YFDbg6jJ6XNue.json","remote":"https://output-ai-execution-dev-trace-files.s3.amazonaws.com/continue_as_new/2026/06/01/2026-06-01-20-00-38-382Z_vzcxpyt1YFDbg6jJ6XNue.json"}}
|
|
3
|
+
{"kind":"step","action":"start","name":"continue_as_new#increment","id":"2","parentId":"019e84c6-23ee-7590-9b96-3677ef70ff7a","timestamp":1780344038432,"details":1}
|
|
4
|
+
{"action":"end","id":"2","timestamp":1780344038432,"details":2}
|
|
5
|
+
{"action":"end","id":"019e84c6-23ee-7590-9b96-3677ef70ff7a","timestamp":1780344038439,"details":"<<continued_as_new>>"}
|
|
6
|
+
{"kind":"workflow","action":"start","name":"continue_as_new","id":"d00ac418-7cb5-434b-a068-910f53f102c6","parentId":"019e84c6-23ee-7590-9b96-3677ef70ff7a","timestamp":1780344039477,"details":{"value":2}}
|
|
7
|
+
{"action":"end","id":"1","timestamp":1780344039484,"details":{"local":"/Users/sz/Dev/output/test_workflows/logs/runs/continue_as_new/2026-06-01-20-00-38-442Z_vzcxpyt1YFDbg6jJ6XNue.json","remote":"https://output-ai-execution-dev-trace-files.s3.amazonaws.com/continue_as_new/2026/06/01/2026-06-01-20-00-38-442Z_vzcxpyt1YFDbg6jJ6XNue.json"}}
|
|
8
|
+
{"kind":"step","action":"start","name":"continue_as_new#increment","id":"2","parentId":"d00ac418-7cb5-434b-a068-910f53f102c6","timestamp":1780344039495,"details":2}
|
|
9
|
+
{"action":"end","id":"2","timestamp":1780344039496,"details":3}
|
|
10
|
+
{"action":"end","id":"d00ac418-7cb5-434b-a068-910f53f102c6","timestamp":1780344039501,"details":{"__output_workflow_wrapper_version":1,"aggregations":null,"trace":{"destinations":{"local":"/Users/sz/Dev/output/test_workflows/logs/runs/continue_as_new/2026-06-01-20-00-38-442Z_vzcxpyt1YFDbg6jJ6XNue.json","remote":"https://output-ai-execution-dev-trace-files.s3.amazonaws.com/continue_as_new/2026/06/01/2026-06-01-20-00-38-442Z_vzcxpyt1YFDbg6jJ6XNue.json"}},"output":{"result":3}}}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
{"kind":"workflow","action":"start","name":"nested","id":"019ecfe5-bbac-78be-97e7-33dbf80a9a89","timestamp":1781604400076,"details":{"values":[1,2,3]}}
|
|
2
|
+
{"action":"end","id":"1","timestamp":1781604400086,"details":{"local":"/Users/sz/Dev/output/test_workflows/logs/runs/nested/2026-06-16-10-06-40-044Z_zHDaeQFtV4vxPm4DXD_UT.json","remote":"https://output-ai-execution-dev-trace-files.s3.amazonaws.com/nested/2026/06/16/2026-06-16-10-06-40-044Z_zHDaeQFtV4vxPm4DXD_UT.json"}}
|
|
3
|
+
{"action":"error","id":"019ecfe5-bbac-78be-97e7-33dbf80a9a89","timestamp":1781604400099,"details":{"name":"Error","message":"Workflow nested input validation failed: [\n {\n \"expected\": \"number\",\n \"code\": \"invalid_type\",\n \"path\": [\n \"value\"\n ],\n \"message\": \"Invalid input: expected number, received undefined\"\n }\n]","stack":"Error: Workflow nested input validation failed: [\n {\n \"expected\": \"number\",\n \"code\": \"invalid_type\",\n \"path\": [\n \"value\"\n ],\n \"message\": \"Invalid input: expected number, received undefined\"\n }\n]\n at validateWithSchema (/app/sdk/core/src/interface/validations/runtime.js:18:0)\n at wrapper (/app/sdk/core/src/interface/workflow.js:137:24)\n at Script.runInContext (node:vm:149:12)\n at Proxy.<anonymous> (/app/node_modules/.pnpm/@temporalio+worker@1.17.0_lightningcss@1.32.0_postcss@8.5.14_tslib@2.8.1/node_modules/@temporalio/worker/lib/workflow/reusable-vm.js:218:45)\n at ReusableVMWorkflow.activate (/app/node_modules/.pnpm/@temporalio+worker@1.17.0_lightningcss@1.32.0_postcss@8.5.14_tslib@2.8.1/node_modules/@temporalio/worker/lib/workflow/vm-shared.js:401:37)\n at handleRequest (/app/node_modules/.pnpm/@temporalio+worker@1.17.0_lightningcss@1.32.0_postcss@8.5.14_tslib@2.8.1/node_modules/@temporalio/worker/lib/workflow/workflow-worker-thread.js:61:47)\n at MessagePort.<anonymous> (/app/node_modules/.pnpm/@temporalio+worker@1.17.0_lightningcss@1.32.0_postcss@8.5.14_tslib@2.8.1/node_modules/@temporalio/worker/lib/workflow/workflow-worker-thread.js:132:28)\n at [nodejs.internal.kHybridDispatch] (node:internal/event_target:843:20)\n at MessagePort.<anonymous> (node:internal/per_context/messageport:23:28)\n at Activator.startWorkflowNextHandler (/app/node_modules/.pnpm/@temporalio+workflow@1.17.0/node_modules/@temporalio/workflow/src/internals.ts:552:11)"}}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{"kind":"workflow","action":"start","name":"nested","id":"019ecfe6-2e5f-78f0-9bfe-722fdb015368","timestamp":1781604429438,"details":{"value":2}}
|
|
2
|
+
{"action":"end","id":"1","timestamp":1781604429446,"details":{"local":"/Users/sz/Dev/output/test_workflows/logs/runs/nested/2026-06-16-10-07-09-407Z_Zv_aX_K9-dU0113mPwitv.json","remote":"https://output-ai-execution-dev-trace-files.s3.amazonaws.com/nested/2026/06/16/2026-06-16-10-07-09-407Z_Zv_aX_K9-dU0113mPwitv.json"}}
|
|
3
|
+
{"kind":"step","action":"start","name":"nested#generateNumber","id":"2","parentId":"019ecfe6-2e5f-78f0-9bfe-722fdb015368","timestamp":1781604429458}
|
|
4
|
+
{"action":"end","id":"2","timestamp":1781604429458,"details":690}
|
|
5
|
+
{"kind":"step","action":"start","name":"nested#generateNumber","id":"3","parentId":"019ecfe6-2e5f-78f0-9bfe-722fdb015368","timestamp":1781604429468}
|
|
6
|
+
{"action":"end","id":"3","timestamp":1781604429469,"details":684}
|
|
7
|
+
{"kind":"workflow","action":"start","name":"simple","id":"019ecfe6-2ea6-7b59-a8b0-4a032fa771c7","parentId":"019ecfe6-2e5f-78f0-9bfe-722fdb015368","timestamp":1781604429499,"details":{"values":[2,690,684]}}
|
|
8
|
+
{"kind":"step","action":"start","name":"simple#sumValues","id":"1","parentId":"019ecfe6-2ea6-7b59-a8b0-4a032fa771c7","timestamp":1781604429504,"details":[2,690,684]}
|
|
9
|
+
{"action":"end","id":"1","timestamp":1781604429505,"details":1376}
|
|
10
|
+
{"action":"end","id":"019ecfe6-2ea6-7b59-a8b0-4a032fa771c7","timestamp":1781604429510,"details":{"__output_workflow_wrapper_version":1,"aggregations":null,"output":{"result":1376,"workflowId":"Zv_aX_K9-dU0113mPwitv-D8qItjVTRFc6Z8Bi5iz1-W"}}}
|
|
11
|
+
{"kind":"workflow","action":"start","name":"simple","id":"019ecfe6-2ed1-7cd3-b4f0-23b8ee474eb9","parentId":"019ecfe6-2e5f-78f0-9bfe-722fdb015368","timestamp":1781604429540,"details":{"values":[2,690,684]}}
|
|
12
|
+
{"kind":"step","action":"start","name":"simple#sumValues","id":"1","parentId":"019ecfe6-2ed1-7cd3-b4f0-23b8ee474eb9","timestamp":1781604429545,"details":[2,690,684]}
|
|
13
|
+
{"action":"end","id":"1","timestamp":1781604429546,"details":1376}
|
|
14
|
+
{"action":"end","id":"019ecfe6-2ed1-7cd3-b4f0-23b8ee474eb9","timestamp":1781604429551,"details":{"__output_workflow_wrapper_version":1,"aggregations":null,"output":{"result":1376,"workflowId":"Zv_aX_K9-dU0113mPwitv-C-ttZFQOlK0ZcF5JcwP-2v"}}}
|
|
15
|
+
{"kind":"workflow","action":"start","name":"shared_demo","id":"019ecfe6-2ef8-7ddc-9d99-65879fb7767f","parentId":"019ecfe6-2e5f-78f0-9bfe-722fdb015368","timestamp":1781604429579}
|
|
16
|
+
{"kind":"step","action":"start","name":"shared_demo#sumValues","id":"1","parentId":"019ecfe6-2ef8-7ddc-9d99-65879fb7767f","timestamp":1781604429585,"details":[1,2,3]}
|
|
17
|
+
{"action":"end","id":"1","timestamp":1781604429585,"details":6}
|
|
18
|
+
{"kind":"step","action":"start","name":"$shared#sharedSumValues","id":"2","parentId":"019ecfe6-2ef8-7ddc-9d99-65879fb7767f","timestamp":1781604429594,"details":[4,5,6]}
|
|
19
|
+
{"action":"end","id":"2","timestamp":1781604429594,"details":15}
|
|
20
|
+
{"action":"end","id":"019ecfe6-2ef8-7ddc-9d99-65879fb7767f","timestamp":1781604429599,"details":{"__output_workflow_wrapper_version":1,"aggregations":null,"output":[6,15]}}
|
|
21
|
+
{"kind":"workflow","action":"start","name":"shared_demo","id":"019ecfe6-2f28-76ad-9c0e-21107aef26b1","parentId":"019ecfe6-2e5f-78f0-9bfe-722fdb015368","timestamp":1781604429626}
|
|
22
|
+
{"kind":"step","action":"start","name":"shared_demo#sumValues","id":"1","parentId":"019ecfe6-2f28-76ad-9c0e-21107aef26b1","timestamp":1781604429632,"details":[1,2,3]}
|
|
23
|
+
{"action":"end","id":"1","timestamp":1781604429633,"details":6}
|
|
24
|
+
{"kind":"step","action":"start","name":"$shared#sharedSumValues","id":"2","parentId":"019ecfe6-2f28-76ad-9c0e-21107aef26b1","timestamp":1781604429643,"details":[4,5,6]}
|
|
25
|
+
{"action":"end","id":"2","timestamp":1781604429643,"details":15}
|
|
26
|
+
{"action":"end","id":"019ecfe6-2f28-76ad-9c0e-21107aef26b1","timestamp":1781604429650,"details":{"__output_workflow_wrapper_version":1,"aggregations":null,"output":[6,15]}}
|
|
27
|
+
{"action":"end","id":"019ecfe6-2e5f-78f0-9bfe-722fdb015368","timestamp":1781604429659,"details":{"__output_workflow_wrapper_version":1,"aggregations":null,"trace":{"destinations":{"local":"/Users/sz/Dev/output/test_workflows/logs/runs/nested/2026-06-16-10-07-09-407Z_Zv_aX_K9-dU0113mPwitv.json","remote":"https://output-ai-execution-dev-trace-files.s3.amazonaws.com/nested/2026/06/16/2026-06-16-10-07-09-407Z_Zv_aX_K9-dU0113mPwitv.json"}},"output":{"values":[2,690,684],"summations":[1376,1376],"sharedResults":[6,15,6,15]}}}
|
|
28
|
+
{"kind":"step","action":"start","name":"$shared#sharedSumValues","id":"2","parentId":"24ea537b-e93b-4bad-9881-26d9bc7daaa4","timestamp":1781604743169,"details":[4,5,6]}
|
|
29
|
+
{"action":"end","id":"2","timestamp":1781604743169,"details":15}
|
|
30
|
+
{"action":"end","id":"24ea537b-e93b-4bad-9881-26d9bc7daaa4","timestamp":1781604743176,"details":{"__output_workflow_wrapper_version":1,"output":[6,15]}}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{"kind":"workflow","action":"start","name":"nested","id":"ba292f3f-e510-4cf4-9b88-ff71f703bb58","timestamp":1781604760372,"details":{"value":2}}
|
|
2
|
+
{"action":"end","id":"1","timestamp":1781604760379,"details":{"local":"/Users/sz/Dev/output/test_workflows/logs/runs/nested/2026-06-16-10-07-09-407Z_Zv_aX_K9-dU0113mPwitv.json","remote":"https://output-ai-execution-dev-trace-files.s3.amazonaws.com/nested/2026/06/16/2026-06-16-10-07-09-407Z_Zv_aX_K9-dU0113mPwitv.json"}}
|
|
3
|
+
{"kind":"step","action":"start","name":"nested#generateNumber","id":"2","parentId":"ba292f3f-e510-4cf4-9b88-ff71f703bb58","timestamp":1781604760390}
|
|
4
|
+
{"action":"end","id":"2","timestamp":1781604760391,"details":761}
|
|
5
|
+
{"kind":"step","action":"start","name":"nested#generateNumber","id":"3","parentId":"ba292f3f-e510-4cf4-9b88-ff71f703bb58","timestamp":1781604760400}
|
|
6
|
+
{"action":"end","id":"3","timestamp":1781604760401,"details":466}
|
|
7
|
+
{"kind":"workflow","action":"start","name":"simple","id":"019ecfeb-3b5a-7345-9d12-0d725517d014","parentId":"ba292f3f-e510-4cf4-9b88-ff71f703bb58","timestamp":1781604760431,"details":{"values":[2,761,466]}}
|
|
8
|
+
{"kind":"step","action":"start","name":"simple#sumValues","id":"1","parentId":"019ecfeb-3b5a-7345-9d12-0d725517d014","timestamp":1781604760438,"details":[2,761,466]}
|
|
9
|
+
{"action":"end","id":"1","timestamp":1781604760438,"details":1229}
|
|
10
|
+
{"action":"end","id":"019ecfeb-3b5a-7345-9d12-0d725517d014","timestamp":1781604760444,"details":{"__output_workflow_wrapper_version":1,"output":{"result":1229,"workflowId":"Zv_aX_K9-dU0113mPwitv-mmEOTXCtCpoVld19NW3wQ"}}}
|
|
11
|
+
{"kind":"workflow","action":"start","name":"simple","id":"019ecfeb-3b86-773e-a27b-56e750758f82","parentId":"ba292f3f-e510-4cf4-9b88-ff71f703bb58","timestamp":1781604760477,"details":{"values":[2,761,466]}}
|
|
12
|
+
{"kind":"step","action":"start","name":"simple#sumValues","id":"1","parentId":"019ecfeb-3b86-773e-a27b-56e750758f82","timestamp":1781604760483,"details":[2,761,466]}
|
|
13
|
+
{"action":"end","id":"1","timestamp":1781604760483,"details":1229}
|
|
14
|
+
{"action":"end","id":"019ecfeb-3b86-773e-a27b-56e750758f82","timestamp":1781604760490,"details":{"__output_workflow_wrapper_version":1,"output":{"result":1229,"workflowId":"Zv_aX_K9-dU0113mPwitv-B2fxbz9dNAzpr154MHhG3i"}}}
|
|
15
|
+
{"kind":"workflow","action":"start","name":"shared_demo","id":"019ecfeb-3bb5-712a-8cd1-6ce79443f86c","parentId":"ba292f3f-e510-4cf4-9b88-ff71f703bb58","timestamp":1781604760521}
|
|
16
|
+
{"kind":"step","action":"start","name":"shared_demo#sumValues","id":"1","parentId":"019ecfeb-3bb5-712a-8cd1-6ce79443f86c","timestamp":1781604760527,"details":[1,2,3]}
|
|
17
|
+
{"action":"end","id":"1","timestamp":1781604760527,"details":6}
|
|
18
|
+
{"kind":"step","action":"start","name":"$shared#sharedSumValues","id":"2","parentId":"019ecfeb-3bb5-712a-8cd1-6ce79443f86c","timestamp":1781604760539,"details":[4,5,6]}
|
|
19
|
+
{"action":"end","id":"2","timestamp":1781604760540,"details":15}
|
|
20
|
+
{"action":"end","id":"019ecfeb-3bb5-712a-8cd1-6ce79443f86c","timestamp":1781604760546,"details":{"__output_workflow_wrapper_version":1,"output":[6,15]}}
|
|
21
|
+
{"kind":"workflow","action":"start","name":"shared_demo","id":"019ecfeb-3bec-72c4-b4c9-b81f27e82882","parentId":"ba292f3f-e510-4cf4-9b88-ff71f703bb58","timestamp":1781604760577}
|
|
22
|
+
{"kind":"step","action":"start","name":"shared_demo#sumValues","id":"1","parentId":"019ecfeb-3bec-72c4-b4c9-b81f27e82882","timestamp":1781604760583,"details":[1,2,3]}
|
|
23
|
+
{"action":"end","id":"1","timestamp":1781604760584,"details":6}
|
|
24
|
+
{"kind":"step","action":"start","name":"$shared#sharedSumValues","id":"2","parentId":"019ecfeb-3bec-72c4-b4c9-b81f27e82882","timestamp":1781604760595,"details":[4,5,6]}
|
|
25
|
+
{"action":"end","id":"2","timestamp":1781604760596,"details":15}
|
|
26
|
+
{"action":"end","id":"019ecfeb-3bec-72c4-b4c9-b81f27e82882","timestamp":1781604760601,"details":{"__output_workflow_wrapper_version":1,"output":[6,15]}}
|
|
27
|
+
{"action":"end","id":"ba292f3f-e510-4cf4-9b88-ff71f703bb58","timestamp":1781604760612,"details":{"__output_workflow_wrapper_version":1,"output":{"values":[2,761,466],"summations":[1229,1229],"sharedResults":[6,15,6,15]},"trace":{"destinations":{"local":"/Users/sz/Dev/output/test_workflows/logs/runs/nested/2026-06-16-10-07-09-407Z_Zv_aX_K9-dU0113mPwitv.json","remote":"https://output-ai-execution-dev-trace-files.s3.amazonaws.com/nested/2026/06/16/2026-06-16-10-07-09-407Z_Zv_aX_K9-dU0113mPwitv.json"}}}}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{"kind":"workflow","action":"start","name":"nested_continue_as_new","id":"019ecfe7-4965-7b9a-b079-3a44916a04e6","timestamp":1781604501888}
|
|
2
|
+
{"action":"end","id":"1","timestamp":1781604501896,"details":{"local":"/Users/sz/Dev/output/test_workflows/logs/runs/nested_continue_as_new/2026-06-16-10-08-21-861Z_66D5ZbAdzuZK4L4Wgw3tf.json","remote":"https://output-ai-execution-dev-trace-files.s3.amazonaws.com/nested_continue_as_new/2026/06/16/2026-06-16-10-08-21-861Z_66D5ZbAdzuZK4L4Wgw3tf.json"}}
|
|
3
|
+
{"kind":"workflow","action":"start","name":"continue_as_new","id":"019ecfe7-4991-7d98-a10e-eef5213c5ffd","parentId":"019ecfe7-4965-7b9a-b079-3a44916a04e6","timestamp":1781604501927,"details":{"value":1}}
|
|
4
|
+
{"kind":"step","action":"start","name":"continue_as_new#increment","id":"1","parentId":"019ecfe7-4991-7d98-a10e-eef5213c5ffd","timestamp":1781604501933,"details":1}
|
|
5
|
+
{"action":"end","id":"1","timestamp":1781604501934,"details":2}
|
|
6
|
+
{"action":"end","id":"019ecfe7-4991-7d98-a10e-eef5213c5ffd","timestamp":1781604501940,"details":"<<continued_as_new>>"}
|
|
7
|
+
{"kind":"workflow","action":"start","name":"continue_as_new","id":"b12a2660-6c53-4642-8c7c-7e177e9202fc","parentId":"019ecfe7-4965-7b9a-b079-3a44916a04e6","timestamp":1781604502957,"details":{"value":2}}
|
|
8
|
+
{"kind":"step","action":"start","name":"continue_as_new#increment","id":"1","parentId":"b12a2660-6c53-4642-8c7c-7e177e9202fc","timestamp":1781604502963,"details":2}
|
|
9
|
+
{"action":"end","id":"1","timestamp":1781604502965,"details":3}
|
|
10
|
+
{"action":"end","id":"b12a2660-6c53-4642-8c7c-7e177e9202fc","timestamp":1781604502970,"details":{"__output_workflow_wrapper_version":1,"aggregations":null,"output":{"result":3}}}
|
|
11
|
+
{"action":"end","id":"019ecfe7-4965-7b9a-b079-3a44916a04e6","timestamp":1781604502979,"details":{"__output_workflow_wrapper_version":1,"aggregations":null,"trace":{"destinations":{"local":"/Users/sz/Dev/output/test_workflows/logs/runs/nested_continue_as_new/2026-06-16-10-08-21-861Z_66D5ZbAdzuZK4L4Wgw3tf.json","remote":"https://output-ai-execution-dev-trace-files.s3.amazonaws.com/nested_continue_as_new/2026/06/16/2026-06-16-10-08-21-861Z_66D5ZbAdzuZK4L4Wgw3tf.json"}}}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"action":"end","id":"049735a9-7a43-4fd5-a66d-de9c13caf5b8","timestamp":1781604731299,"details":{"__output_workflow_wrapper_version":1,"trace":{"destinations":{"local":"/Users/sz/Dev/output/test_workflows/logs/runs/nested_continue_as_new/2026-06-16-10-08-21-861Z_66D5ZbAdzuZK4L4Wgw3tf.json","remote":"https://output-ai-execution-dev-trace-files.s3.amazonaws.com/nested_continue_as_new/2026/06/16/2026-06-16-10-08-21-861Z_66D5ZbAdzuZK4L4Wgw3tf.json"}}}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"action":"end","id":"294d05f8-dc1f-40f3-bc1a-808c9987bca2","timestamp":1781604644958,"details":{"__output_workflow_wrapper_version":1,"aggregations":null,"trace":{"destinations":{"local":"/Users/sz/Dev/output/test_workflows/logs/runs/nested_continue_as_new/2026-06-16-10-08-21-861Z_66D5ZbAdzuZK4L4Wgw3tf.json","remote":"https://output-ai-execution-dev-trace-files.s3.amazonaws.com/nested_continue_as_new/2026/06/16/2026-06-16-10-08-21-861Z_66D5ZbAdzuZK4L4Wgw3tf.json"}}}}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
{"kind":"workflow","action":"start","name":"web_search","id":"019ed70b-093a-7b81-ab9c-d2b721e0da41","timestamp":1781724285270,"details":{"query":"What are the latest developments in AI from the past week?"}}
|
|
2
|
+
{"action":"end","id":"1","timestamp":1781724285279,"details":{"local":"/Users/sz/Dev/output/test_workflows/logs/runs/web_search/2026-06-17-19-24-45-242Z_ERA6j2kw487YHJ8gkWhTy.json","remote":"https://output-ai-execution-dev-trace-files.s3.amazonaws.com/web_search/2026/06/17/2026-06-17-19-24-45-242Z_ERA6j2kw487YHJ8gkWhTy.json"}}
|
|
3
|
+
{"kind":"step","action":"start","name":"web_search#searchWeb","id":"2","parentId":"019ed70b-093a-7b81-ab9c-d2b721e0da41","timestamp":1781724285294,"details":{"query":"What are the latest developments in AI from the past week?"}}
|
|
4
|
+
{"kind":"llm","action":"start","name":"generateText","id":"generateText-1781724285302","parentId":"2","timestamp":1781724285302,"details":{"prompt":"web_search@v1","variables":{"query":"What are the latest developments in AI from the past week?"},"loadedPrompt":{"name":"web_search@v1","config":{"provider":"anthropic","model":"claude-sonnet-4-6","maxTokens":1024},"messages":[{"role":"system","content":"You are a research assistant. Use the search tool to find current information, then provide a comprehensive answer based on the results."},{"role":"user","content":"What are the latest developments in AI from the past week?"}],"instructions":null,"promptFileDir":"/app/test_workflows/dist/workflows/llm/web_search/prompts"}}}
|
|
5
|
+
{"action":"add_attr","id":"generateText-1781724285302","parentId":"2","timestamp":1781724296832,"details":{"type":"llm:usage","modelId":"claude-sonnet-4-6","usage":[{"type":"input","ppm":3,"amount":2826,"total":0.008478},{"type":"input_cached","ppm":0.3,"amount":0,"total":0},{"type":"output","ppm":15,"amount":606,"total":0.00909}],"total":0.017568,"tokensUsed":3432}}
|
|
6
|
+
{"action":"end","id":"generateText-1781724285302","parentId":"2","timestamp":1781724296833,"details":{"result":"I apologize, but I'm currently unable to retrieve live search results due to a configuration issue with the search tool — the API key required to access real-time data isn't available at the moment.\n\nHowever, here's how you can **stay up to date on the latest AI developments** yourself:\n\n---\n\n### 📰 Recommended Sources for AI News\n\n1. **The Verge – AI Section** → [theverge.com/ai-artificial-intelligence](https://www.theverge.com/ai-artificial-intelligence)\n2. **MIT Technology Review** → [technologyreview.com](https://www.technologyreview.com)\n3. **TechCrunch AI** → [techcrunch.com/category/artificial-intelligence](https://techcrunch.com/category/artificial-intelligence)\n4. **Wired AI** → [wired.com/tag/artificial-intelligence](https://www.wired.com/tag/artificial-intelligence)\n5. **VentureBeat AI** → [venturebeat.com/ai](https://venturebeat.com/ai/)\n6. **ArXiv (Research Papers)** → [arxiv.org/list/cs.AI/recent](https://arxiv.org/list/cs.AI/recent)\n7. **Google DeepMind Blog** → [deepmind.google/discover/blog](https://deepmind.google/discover/blog/)\n8. **OpenAI News** → [openai.com/news](https://openai.com/news/)\n\n---\n\n### 🔍 Tips for Staying Current\n- Set up **Google Alerts** for terms like \"AI news,\" \"large language models,\" or specific companies (OpenAI, Google DeepMind, Anthropic, Meta AI, etc.)\n- Follow AI researchers and journalists on **X (Twitter)** or **LinkedIn**\n- Subscribe to newsletters like **The Rundown AI**, **Import AI**, or **TLDR AI**\n\n---\n\nI apologize again for not being able to pull live results right now. If this issue is resolved, feel free to ask again and I'll provide a detailed, up-to-the-minute briefing! 🤖","usage":{"inputTokens":2826,"inputTokenDetails":{"noCacheTokens":2826,"cacheReadTokens":0,"cacheWriteTokens":0},"outputTokens":606,"outputTokenDetails":{},"totalTokens":3432,"cachedInputTokens":0},"providerMetadata":{"anthropic":{"usage":{"input_tokens":1494,"output_tokens":510,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"service_tier":"standard","inference_geo":"global"},"cacheCreationInputTokens":0,"stopSequence":null,"iterations":null,"container":null,"contextManagement":null}},"sourcesFromTools":[]}}
|
|
7
|
+
{"action":"end","id":"2","timestamp":1781724296833,"details":{"answer":"I apologize, but I'm currently unable to retrieve live search results due to a configuration issue with the search tool — the API key required to access real-time data isn't available at the moment.\n\nHowever, here's how you can **stay up to date on the latest AI developments** yourself:\n\n---\n\n### 📰 Recommended Sources for AI News\n\n1. **The Verge – AI Section** → [theverge.com/ai-artificial-intelligence](https://www.theverge.com/ai-artificial-intelligence)\n2. **MIT Technology Review** → [technologyreview.com](https://www.technologyreview.com)\n3. **TechCrunch AI** → [techcrunch.com/category/artificial-intelligence](https://techcrunch.com/category/artificial-intelligence)\n4. **Wired AI** → [wired.com/tag/artificial-intelligence](https://www.wired.com/tag/artificial-intelligence)\n5. **VentureBeat AI** → [venturebeat.com/ai](https://venturebeat.com/ai/)\n6. **ArXiv (Research Papers)** → [arxiv.org/list/cs.AI/recent](https://arxiv.org/list/cs.AI/recent)\n7. **Google DeepMind Blog** → [deepmind.google/discover/blog](https://deepmind.google/discover/blog/)\n8. **OpenAI News** → [openai.com/news](https://openai.com/news/)\n\n---\n\n### 🔍 Tips for Staying Current\n- Set up **Google Alerts** for terms like \"AI news,\" \"large language models,\" or specific companies (OpenAI, Google DeepMind, Anthropic, Meta AI, etc.)\n- Follow AI researchers and journalists on **X (Twitter)** or **LinkedIn**\n- Subscribe to newsletters like **The Rundown AI**, **Import AI**, or **TLDR AI**\n\n---\n\nI apologize again for not being able to pull live results right now. If this issue is resolved, feel free to ask again and I'll provide a detailed, up-to-the-minute briefing! 🤖","sources":[]}}
|
|
8
|
+
{"action":"end","id":"019ed70b-093a-7b81-ab9c-d2b721e0da41","timestamp":1781724296842,"details":{"__output_workflow_wrapper_version":1,"output":{"answer":"I apologize, but I'm currently unable to retrieve live search results due to a configuration issue with the search tool — the API key required to access real-time data isn't available at the moment.\n\nHowever, here's how you can **stay up to date on the latest AI developments** yourself:\n\n---\n\n### 📰 Recommended Sources for AI News\n\n1. **The Verge – AI Section** → [theverge.com/ai-artificial-intelligence](https://www.theverge.com/ai-artificial-intelligence)\n2. **MIT Technology Review** → [technologyreview.com](https://www.technologyreview.com)\n3. **TechCrunch AI** → [techcrunch.com/category/artificial-intelligence](https://techcrunch.com/category/artificial-intelligence)\n4. **Wired AI** → [wired.com/tag/artificial-intelligence](https://www.wired.com/tag/artificial-intelligence)\n5. **VentureBeat AI** → [venturebeat.com/ai](https://venturebeat.com/ai/)\n6. **ArXiv (Research Papers)** → [arxiv.org/list/cs.AI/recent](https://arxiv.org/list/cs.AI/recent)\n7. **Google DeepMind Blog** → [deepmind.google/discover/blog](https://deepmind.google/discover/blog/)\n8. **OpenAI News** → [openai.com/news](https://openai.com/news/)\n\n---\n\n### 🔍 Tips for Staying Current\n- Set up **Google Alerts** for terms like \"AI news,\" \"large language models,\" or specific companies (OpenAI, Google DeepMind, Anthropic, Meta AI, etc.)\n- Follow AI researchers and journalists on **X (Twitter)** or **LinkedIn**\n- Subscribe to newsletters like **The Rundown AI**, **Import AI**, or **TLDR AI**\n\n---\n\nI apologize again for not being able to pull live results right now. If this issue is resolved, feel free to ask again and I'll provide a detailed, up-to-the-minute briefing! 🤖","sources":[]},"trace":{"destinations":{"local":"/Users/sz/Dev/output/test_workflows/logs/runs/web_search/2026-06-17-19-24-45-242Z_ERA6j2kw487YHJ8gkWhTy.json","remote":"https://output-ai-execution-dev-trace-files.s3.amazonaws.com/web_search/2026/06/17/2026-06-17-19-24-45-242Z_ERA6j2kw487YHJ8gkWhTy.json"}}}}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{"kind":"workflow","action":"start","name":"nested_indirect_call","id":"019ee179-041c-74d3-bbfb-b3486e610779","timestamp":1781899265082}
|
|
2
|
+
{"action":"end","id":"1","timestamp":1781899265092,"details":{"local":"/Users/sz/Dev/output/test_workflows/logs/runs/nested_indirect_call/2026-06-19-20-01-05-052Z_KttUuUSkR1FsepnovKICa.json","remote":"https://output-ai-execution-dev-trace-files.s3.amazonaws.com/nested_indirect_call/2026/06/19/2026-06-19-20-01-05-052Z_KttUuUSkR1FsepnovKICa.json"}}
|
|
3
|
+
{"kind":"workflow","action":"start","name":"nested_indirect_call_child","id":"019ee179-045a-764b-933f-0744442614ad","parentId":"019ee179-041c-74d3-bbfb-b3486e610779","timestamp":1781899265139}
|
|
4
|
+
{"kind":"workflow","action":"start","name":"http_simple","id":"019ee179-0476-7d28-8a93-531ffa4910b7","parentId":"019ee179-045a-764b-933f-0744442614ad","timestamp":1781899265166}
|
|
5
|
+
{"kind":"step","action":"start","name":"http_simple#callHttpWithCost","id":"1","parentId":"019ee179-0476-7d28-8a93-531ffa4910b7","timestamp":1781899265174}
|
|
6
|
+
{"kind":"http","action":"start","name":"request","id":"cad2e5c1-5b42-4732-b30b-7964e56775ff","parentId":"1","timestamp":1781899265176,"details":{"method":"GET","url":"https://httpbin.io/anything/http-cost"}}
|
|
7
|
+
{"action":"add_attr","id":"cad2e5c1-5b42-4732-b30b-7964e56775ff","parentId":"1","timestamp":1781899265177,"details":{"type":"http:request:count","url":"https://httpbin.io/anything/http-cost","requestId":"cad2e5c1-5b42-4732-b30b-7964e56775ff"}}
|
|
8
|
+
{"action":"end","id":"cad2e5c1-5b42-4732-b30b-7964e56775ff","parentId":"1","timestamp":1781899265691,"details":{"status":200,"statusText":"OK"}}
|
|
9
|
+
{"action":"add_attr","id":"cad2e5c1-5b42-4732-b30b-7964e56775ff","parentId":"1","timestamp":1781899265692,"details":{"type":"http:request:cost","url":"https://httpbin.io/anything/http-cost","requestId":"cad2e5c1-5b42-4732-b30b-7964e56775ff","total":1}}
|
|
10
|
+
{"action":"end","id":"1","timestamp":1781899265693,"details":"200"}
|
|
11
|
+
{"action":"end","id":"019ee179-0476-7d28-8a93-531ffa4910b7","timestamp":1781899265702,"details":{"__output_workflow_wrapper_version":1,"output":"200"}}
|
|
12
|
+
{"action":"end","id":"019ee179-045a-764b-933f-0744442614ad","timestamp":1781899265713,"details":{"__output_workflow_wrapper_version":1,"output":{"value":"200"}}}
|
|
13
|
+
{"action":"end","id":"019ee179-041c-74d3-bbfb-b3486e610779","timestamp":1781899265721,"details":{"__output_workflow_wrapper_version":1,"output":{"value":"200"},"trace":{"destinations":{"local":"/Users/sz/Dev/output/test_workflows/logs/runs/nested_indirect_call/2026-06-19-20-01-05-052Z_KttUuUSkR1FsepnovKICa.json","remote":"https://output-ai-execution-dev-trace-files.s3.amazonaws.com/nested_indirect_call/2026/06/19/2026-06-19-20-01-05-052Z_KttUuUSkR1FsepnovKICa.json"}}}}
|
package/src/worker/configs.js
CHANGED
|
@@ -5,6 +5,13 @@ class InvalidEnvVarsErrors extends Error { }
|
|
|
5
5
|
|
|
6
6
|
const coalesceEmptyString = v => v === '' ? undefined : v;
|
|
7
7
|
|
|
8
|
+
const durationSchema = z.preprocess(
|
|
9
|
+
coalesceEmptyString,
|
|
10
|
+
z.string()
|
|
11
|
+
.regex( /^\d+$|^\d+(\.\d+)?\s?(ms|s|m|h|d)$/i )
|
|
12
|
+
.optional()
|
|
13
|
+
);
|
|
14
|
+
|
|
8
15
|
const envVarSchema = z.object( {
|
|
9
16
|
OUTPUT_CATALOG_ID: z.string().regex( /^[a-z0-9_.@-]+$/i ),
|
|
10
17
|
OUTPUT_WORKER_TELEMETRY_INTERVAL_MS: z.preprocess( coalesceEmptyString, z.coerce.number().int().nonnegative().default( 0 ) ),
|
|
@@ -28,6 +35,10 @@ const envVarSchema = z.object( {
|
|
|
28
35
|
OUTPUT_ACTIVITY_HEARTBEAT_ENABLED: z.transform( v => v === undefined ? true : isStringboolTrue( v ) ),
|
|
29
36
|
// Time to allow for hooks to flush before shutdown
|
|
30
37
|
OUTPUT_PROCESS_FAILURE_SHUTDOWN_DELAY: z.preprocess( coalesceEmptyString, z.coerce.number().int().positive().default( 3000 ) ),
|
|
38
|
+
// Set temporal worker shutdown force time
|
|
39
|
+
TEMPORAL_SHUTDOWN_FORCE_TIME: durationSchema,
|
|
40
|
+
// Set temporal worker shutdown grace time
|
|
41
|
+
TEMPORAL_SHUTDOWN_GRACE_TIME: durationSchema,
|
|
31
42
|
// HTTP CONNECT proxy for Temporal gRPC connections (e.g. "proxy-host:8080").
|
|
32
43
|
// Must be a bare host:port — no scheme (Temporal's native HTTP CONNECT
|
|
33
44
|
// option is not a URL).
|
|
@@ -56,4 +67,6 @@ export const workerTelemetryIntervalMs = envVars.OUTPUT_WORKER_TELEMETRY_INTERVA
|
|
|
56
67
|
export const activityHeartbeatIntervalMs = envVars.OUTPUT_ACTIVITY_HEARTBEAT_INTERVAL_MS;
|
|
57
68
|
export const activityHeartbeatEnabled = envVars.OUTPUT_ACTIVITY_HEARTBEAT_ENABLED;
|
|
58
69
|
export const processFailureShutdownDelay = envVars.OUTPUT_PROCESS_FAILURE_SHUTDOWN_DELAY;
|
|
70
|
+
export const shutdownForceTime = envVars.TEMPORAL_SHUTDOWN_FORCE_TIME;
|
|
71
|
+
export const shutdownGraceTime = envVars.TEMPORAL_SHUTDOWN_GRACE_TIME;
|
|
59
72
|
export const grpcProxy = envVars.TEMPORAL_GRPC_PROXY;
|
|
@@ -12,7 +12,9 @@ const CONFIG_KEYS = [
|
|
|
12
12
|
'TEMPORAL_MAX_CONCURRENT_WORKFLOW_TASK_POLLS',
|
|
13
13
|
'OUTPUT_WORKER_TELEMETRY_INTERVAL_MS',
|
|
14
14
|
'OUTPUT_ACTIVITY_HEARTBEAT_INTERVAL_MS',
|
|
15
|
-
'OUTPUT_ACTIVITY_HEARTBEAT_ENABLED'
|
|
15
|
+
'OUTPUT_ACTIVITY_HEARTBEAT_ENABLED',
|
|
16
|
+
'TEMPORAL_SHUTDOWN_FORCE_TIME',
|
|
17
|
+
'TEMPORAL_SHUTDOWN_GRACE_TIME'
|
|
16
18
|
];
|
|
17
19
|
|
|
18
20
|
const setEnv = ( overrides = {} ) => {
|
|
@@ -65,6 +67,8 @@ describe( 'worker/configs', () => {
|
|
|
65
67
|
expect( configs.workerTelemetryIntervalMs ).toBe( 0 );
|
|
66
68
|
expect( configs.activityHeartbeatIntervalMs ).toBe( 2 * 60 * 1000 );
|
|
67
69
|
expect( configs.activityHeartbeatEnabled ).toBe( true );
|
|
70
|
+
expect( configs.shutdownForceTime ).toBeUndefined();
|
|
71
|
+
expect( configs.shutdownGraceTime ).toBeUndefined();
|
|
68
72
|
expect( configs.taskQueue ).toBe( 'test-catalog' );
|
|
69
73
|
expect( configs.catalogId ).toBe( 'test-catalog' );
|
|
70
74
|
} );
|
|
@@ -100,6 +104,35 @@ describe( 'worker/configs', () => {
|
|
|
100
104
|
expect( configs.activityHeartbeatIntervalMs ).toBe( 60000 );
|
|
101
105
|
} );
|
|
102
106
|
|
|
107
|
+
it( 'parses Temporal shutdown durations', async () => {
|
|
108
|
+
setEnv( {
|
|
109
|
+
TEMPORAL_SHUTDOWN_FORCE_TIME: '15000',
|
|
110
|
+
TEMPORAL_SHUTDOWN_GRACE_TIME: '15s'
|
|
111
|
+
} );
|
|
112
|
+
const configs = await loadConfigs();
|
|
113
|
+
|
|
114
|
+
expect( configs.shutdownForceTime ).toBe( '15000' );
|
|
115
|
+
expect( configs.shutdownGraceTime ).toBe( '15s' );
|
|
116
|
+
} );
|
|
117
|
+
|
|
118
|
+
it( 'treats empty Temporal shutdown durations as unset', async () => {
|
|
119
|
+
setEnv( {
|
|
120
|
+
TEMPORAL_SHUTDOWN_FORCE_TIME: '',
|
|
121
|
+
TEMPORAL_SHUTDOWN_GRACE_TIME: ''
|
|
122
|
+
} );
|
|
123
|
+
const configs = await loadConfigs();
|
|
124
|
+
|
|
125
|
+
expect( configs.shutdownForceTime ).toBeUndefined();
|
|
126
|
+
expect( configs.shutdownGraceTime ).toBeUndefined();
|
|
127
|
+
} );
|
|
128
|
+
|
|
129
|
+
it( 'throws when Temporal shutdown durations are invalid', async () => {
|
|
130
|
+
setEnv( { TEMPORAL_SHUTDOWN_FORCE_TIME: 'soon' } );
|
|
131
|
+
vi.resetModules();
|
|
132
|
+
|
|
133
|
+
await expect( import( './configs.js' ) ).rejects.toThrow();
|
|
134
|
+
} );
|
|
135
|
+
|
|
103
136
|
it( 'allows zero for worker telemetry interval', async () => {
|
|
104
137
|
setEnv( { OUTPUT_WORKER_TELEMETRY_INTERVAL_MS: '0' } );
|
|
105
138
|
const configs = await loadConfigs();
|
|
@@ -2,13 +2,6 @@ import { createChildLogger } from '#logger';
|
|
|
2
2
|
import { setTimeout as delay } from 'node:timers/promises';
|
|
3
3
|
import { CancellablePromise } from '#utils';
|
|
4
4
|
|
|
5
|
-
const ServingStatus = {
|
|
6
|
-
UNKNOWN: 0,
|
|
7
|
-
SERVING: 1,
|
|
8
|
-
NOT_SERVING: 2,
|
|
9
|
-
SERVICE_UNKNOWN: 3
|
|
10
|
-
};
|
|
11
|
-
|
|
12
5
|
const log = createChildLogger( 'Connection' );
|
|
13
6
|
|
|
14
7
|
export class TemporalConnectionMonitor {
|
|
@@ -28,24 +21,20 @@ export class TemporalConnectionMonitor {
|
|
|
28
21
|
throw new Error( 'Connection health check timed out' );
|
|
29
22
|
} );
|
|
30
23
|
|
|
31
|
-
#healthcheck = async () => this.#connection.
|
|
24
|
+
#healthcheck = async () => this.#connection.workflowService.getSystemInfo( {} );
|
|
32
25
|
|
|
33
26
|
#sleep = async () => delay( this.#CHECK_INTERVAL_MS, 0, { ref: false } );
|
|
34
27
|
|
|
35
28
|
#watch = async () => {
|
|
36
29
|
while ( !this.#cancellation.completed ) {
|
|
37
30
|
try {
|
|
38
|
-
|
|
31
|
+
await Promise.race( [ this.#healthcheck(), this.#getTimeout(), this.#cancellation.promise ] );
|
|
39
32
|
|
|
40
33
|
// cancellation won the race
|
|
41
34
|
if ( this.#cancellation.completed ) {
|
|
42
35
|
break;
|
|
43
36
|
}
|
|
44
37
|
|
|
45
|
-
if ( health?.status !== ServingStatus.SERVING ) {
|
|
46
|
-
throw new Error( `Connection not serving (status ${health?.status})` );
|
|
47
|
-
}
|
|
48
|
-
|
|
49
38
|
log.info( this.#failures === 0 ? 'Healthy' : 'Recovered' );
|
|
50
39
|
this.#failures = 0;
|
|
51
40
|
} catch ( error ) {
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
|
2
2
|
import { TemporalConnectionMonitor } from './connection_monitor.js';
|
|
3
3
|
|
|
4
|
-
const SERVING = 1;
|
|
5
|
-
const NOT_SERVING = 2;
|
|
6
4
|
const CHECK_TIMEOUT_MS = 50;
|
|
7
5
|
const CHECK_INTERVAL_MS = 100;
|
|
8
6
|
|
|
@@ -26,7 +24,7 @@ vi.mock( 'node:timers/promises', () => ( { setTimeout: delayMock } ) );
|
|
|
26
24
|
vi.mock( '#logger', () => ( { createChildLogger: vi.fn( () => mockLogger ) } ) );
|
|
27
25
|
|
|
28
26
|
const createConnection = check => ( {
|
|
29
|
-
|
|
27
|
+
workflowService: { getSystemInfo: check }
|
|
30
28
|
} );
|
|
31
29
|
|
|
32
30
|
const createMonitor = ( check, overrides = {} ) => new TemporalConnectionMonitor( createConnection( check ), {
|
|
@@ -52,8 +50,8 @@ describe( 'TemporalConnectionMonitor', () => {
|
|
|
52
50
|
scheduledDelays.length = 0;
|
|
53
51
|
} );
|
|
54
52
|
|
|
55
|
-
it( 'logs healthy when the
|
|
56
|
-
const check = vi.fn().mockResolvedValue( {
|
|
53
|
+
it( 'logs healthy when the workflow service is reachable', async () => {
|
|
54
|
+
const check = vi.fn().mockResolvedValue( {} );
|
|
57
55
|
const monitor = createMonitor( check );
|
|
58
56
|
|
|
59
57
|
const run = monitor.start();
|
|
@@ -90,7 +88,7 @@ describe( 'TemporalConnectionMonitor', () => {
|
|
|
90
88
|
it( 'logs recovered after a transient failure succeeds', async () => {
|
|
91
89
|
const check = vi.fn()
|
|
92
90
|
.mockRejectedValueOnce( new Error( 'temporary outage' ) )
|
|
93
|
-
.mockResolvedValueOnce( {
|
|
91
|
+
.mockResolvedValueOnce( {} );
|
|
94
92
|
const monitor = createMonitor( check );
|
|
95
93
|
|
|
96
94
|
monitor.start();
|
|
@@ -134,21 +132,6 @@ describe( 'TemporalConnectionMonitor', () => {
|
|
|
134
132
|
expect( monitor.running ).toBe( false );
|
|
135
133
|
} );
|
|
136
134
|
|
|
137
|
-
it( 'treats non-serving health status as a failure', async () => {
|
|
138
|
-
const check = vi.fn().mockResolvedValue( { status: NOT_SERVING } );
|
|
139
|
-
const monitor = createMonitor( check );
|
|
140
|
-
|
|
141
|
-
monitor.start();
|
|
142
|
-
await flushPromises();
|
|
143
|
-
|
|
144
|
-
expect( mockLogger.warn ).toHaveBeenCalledWith( 'Connection unhealthy', {
|
|
145
|
-
error: `Connection not serving (status ${NOT_SERVING})`,
|
|
146
|
-
failures: 1
|
|
147
|
-
} );
|
|
148
|
-
|
|
149
|
-
await monitor.stop();
|
|
150
|
-
} );
|
|
151
|
-
|
|
152
135
|
it( 'returns the same lifecycle promise when started more than once', async () => {
|
|
153
136
|
const check = vi.fn().mockReturnValue( new Promise( () => {} ) );
|
|
154
137
|
const monitor = createMonitor( check );
|
package/src/worker/index.js
CHANGED
|
@@ -33,7 +33,9 @@ const {
|
|
|
33
33
|
maxConcurrentActivityTaskExecutions,
|
|
34
34
|
maxCachedWorkflows,
|
|
35
35
|
maxConcurrentActivityTaskPolls,
|
|
36
|
-
maxConcurrentWorkflowTaskPolls
|
|
36
|
+
maxConcurrentWorkflowTaskPolls,
|
|
37
|
+
shutdownForceTime,
|
|
38
|
+
shutdownGraceTime
|
|
37
39
|
} = configs;
|
|
38
40
|
|
|
39
41
|
const state = {
|
|
@@ -73,6 +75,7 @@ const execute = async () => {
|
|
|
73
75
|
if ( proxy ) {
|
|
74
76
|
log.info( 'Using gRPC proxy', { targetHost: grpcProxy } );
|
|
75
77
|
}
|
|
78
|
+
|
|
76
79
|
state.connection = await NativeConnection.connect( { address, tls: Boolean( apiKey ), apiKey, proxy } );
|
|
77
80
|
|
|
78
81
|
log.info( 'Creating connection monitor...' );
|
|
@@ -95,7 +98,9 @@ const execute = async () => {
|
|
|
95
98
|
maxCachedWorkflows,
|
|
96
99
|
maxConcurrentActivityTaskPolls,
|
|
97
100
|
maxConcurrentWorkflowTaskPolls,
|
|
98
|
-
bundlerOptions: { webpackConfigHook }
|
|
101
|
+
bundlerOptions: { webpackConfigHook },
|
|
102
|
+
...( shutdownForceTime !== undefined && { shutdownForceTime } ),
|
|
103
|
+
...( shutdownGraceTime !== undefined && { shutdownGraceTime } )
|
|
99
104
|
} );
|
|
100
105
|
|
|
101
106
|
log.info( 'Setting up telemetry...' );
|
package/src/worker/index.spec.js
CHANGED
|
@@ -44,7 +44,9 @@ const {
|
|
|
44
44
|
maxCachedWorkflows: 1000,
|
|
45
45
|
maxConcurrentActivityTaskPolls: 5,
|
|
46
46
|
maxConcurrentWorkflowTaskPolls: 5,
|
|
47
|
-
processFailureShutdownDelay: 0
|
|
47
|
+
processFailureShutdownDelay: 0,
|
|
48
|
+
shutdownForceTime: undefined,
|
|
49
|
+
shutdownGraceTime: undefined
|
|
48
50
|
};
|
|
49
51
|
|
|
50
52
|
const connectionMonitorInstance = {
|
|
@@ -180,6 +182,8 @@ describe( 'worker/index', () => {
|
|
|
180
182
|
resetPromises();
|
|
181
183
|
configValues.apiKey = undefined;
|
|
182
184
|
configValues.grpcProxy = undefined;
|
|
185
|
+
configValues.shutdownForceTime = undefined;
|
|
186
|
+
configValues.shutdownGraceTime = undefined;
|
|
183
187
|
catalogJobInstance.error = null;
|
|
184
188
|
catalogJobInstance.errorCb = null;
|
|
185
189
|
catalogJobInstance.running = false;
|
|
@@ -237,6 +241,8 @@ describe( 'worker/index', () => {
|
|
|
237
241
|
maxConcurrentActivityTaskPolls: configValues.maxConcurrentActivityTaskPolls,
|
|
238
242
|
maxConcurrentWorkflowTaskPolls: configValues.maxConcurrentWorkflowTaskPolls
|
|
239
243
|
} ) );
|
|
244
|
+
expect( Worker.create.mock.calls[0][0] ).not.toHaveProperty( 'shutdownForceTime' );
|
|
245
|
+
expect( Worker.create.mock.calls[0][0] ).not.toHaveProperty( 'shutdownGraceTime' );
|
|
240
246
|
expect( initInterceptorsMock ).toHaveBeenCalledWith( { activities: {}, workflows: [] } );
|
|
241
247
|
expect( setupTelemetryMock ).toHaveBeenCalledWith( { worker: mockWorker } );
|
|
242
248
|
expect( setupInterruptionHandlerMock ).toHaveBeenCalledWith( expect.any( Function ) );
|
|
@@ -264,6 +270,21 @@ describe( 'worker/index', () => {
|
|
|
264
270
|
await settleWorker();
|
|
265
271
|
} );
|
|
266
272
|
|
|
273
|
+
it( 'passes configured shutdown durations to the worker', async () => {
|
|
274
|
+
configValues.shutdownForceTime = '30s';
|
|
275
|
+
configValues.shutdownGraceTime = '10s';
|
|
276
|
+
const { Worker } = await import( '@temporalio/worker' );
|
|
277
|
+
|
|
278
|
+
await importWorker();
|
|
279
|
+
|
|
280
|
+
await vi.waitFor( () => expect( Worker.create ).toHaveBeenCalledWith( expect.objectContaining( {
|
|
281
|
+
shutdownForceTime: '30s',
|
|
282
|
+
shutdownGraceTime: '10s'
|
|
283
|
+
} ) ) );
|
|
284
|
+
|
|
285
|
+
await settleWorker();
|
|
286
|
+
} );
|
|
287
|
+
|
|
267
288
|
it( 'runs graceful shutdown when interrupted', async () => {
|
|
268
289
|
await importWorker();
|
|
269
290
|
|
|
@@ -3,6 +3,7 @@ import { createChildLogger } from '#logger';
|
|
|
3
3
|
const log = createChildLogger( 'Interruption' );
|
|
4
4
|
|
|
5
5
|
const FORCE_QUIT_GRACE_MS = 1000;
|
|
6
|
+
const INTERRUPTION_SIGNALS = [ 'SIGTERM', 'SIGINT', 'SIGUSR2' ];
|
|
6
7
|
|
|
7
8
|
export const setupInterruptionHandler = cb => {
|
|
8
9
|
const state = { interruptionReceivedAt: null };
|
|
@@ -28,6 +29,5 @@ export const setupInterruptionHandler = cb => {
|
|
|
28
29
|
cb();
|
|
29
30
|
};
|
|
30
31
|
|
|
31
|
-
process.on(
|
|
32
|
-
process.on( 'SIGINT', () => handle( 'SIGINT' ) );
|
|
32
|
+
INTERRUPTION_SIGNALS.forEach( signal => process.on( signal, () => handle( signal ) ) );
|
|
33
33
|
};
|
|
@@ -29,11 +29,12 @@ describe( 'setupInterruptionHandler', () => {
|
|
|
29
29
|
process.exit = originalExit;
|
|
30
30
|
} );
|
|
31
31
|
|
|
32
|
-
it( 'registers
|
|
32
|
+
it( 'registers interruption signal handlers', () => {
|
|
33
33
|
setupInterruptionHandler( callback );
|
|
34
34
|
|
|
35
35
|
expect( process.on ).toHaveBeenCalledWith( 'SIGTERM', expect.any( Function ) );
|
|
36
36
|
expect( process.on ).toHaveBeenCalledWith( 'SIGINT', expect.any( Function ) );
|
|
37
|
+
expect( process.on ).toHaveBeenCalledWith( 'SIGUSR2', expect.any( Function ) );
|
|
37
38
|
} );
|
|
38
39
|
|
|
39
40
|
it( 'logs and invokes callback on first SIGTERM', () => {
|
|
@@ -58,6 +59,17 @@ describe( 'setupInterruptionHandler', () => {
|
|
|
58
59
|
expect( exitMock ).not.toHaveBeenCalled();
|
|
59
60
|
} );
|
|
60
61
|
|
|
62
|
+
it( 'logs and invokes callback on first SIGUSR2', () => {
|
|
63
|
+
setupInterruptionHandler( callback );
|
|
64
|
+
|
|
65
|
+
onHandlers.SIGUSR2();
|
|
66
|
+
|
|
67
|
+
expect( mockLog.info ).toHaveBeenCalledWith( 'Signal Received', { signal: 'SIGUSR2' } );
|
|
68
|
+
expect( mockLog.warn ).toHaveBeenCalledWith( 'Initiating shutdown...' );
|
|
69
|
+
expect( callback ).toHaveBeenCalledOnce();
|
|
70
|
+
expect( exitMock ).not.toHaveBeenCalled();
|
|
71
|
+
} );
|
|
72
|
+
|
|
61
73
|
it( 'ignores a second signal received within the grace period', () => {
|
|
62
74
|
vi.useFakeTimers();
|
|
63
75
|
setupInterruptionHandler( callback );
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
"execute_in_parallel#sumValues": {
|
|
3
|
+
"retry": {
|
|
4
|
+
"initialInterval": "5s"
|
|
5
|
+
}
|
|
6
|
+
},
|
|
7
|
+
"helper_fn#sumValues": {
|
|
8
|
+
"retry": {
|
|
9
|
+
"initialInterval": "5s"
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
"simple#sumValues": {
|
|
13
|
+
"retry": {
|
|
14
|
+
"initialInterval": "5s"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"simple_alias#sumValues": {
|
|
18
|
+
"retry": {
|
|
19
|
+
"initialInterval": "5s"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"__subtract_numbers#subtractValues": {
|
|
23
|
+
"retry": {
|
|
24
|
+
"initialInterval": "5s"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"__sum_numbers#sumValues": {
|
|
28
|
+
"retry": {
|
|
29
|
+
"initialInterval": "5s"
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
export { default as continue_as_new } from '/app/test_workflows/dist/workflows/continue_as_new/workflow.js';
|
|
2
|
+
export { default as credentials_demo } from '/app/test_workflows/dist/workflows/credentials_demo/workflow.js';
|
|
3
|
+
export { default as test_error } from '/app/test_workflows/dist/workflows/error/workflow.js';
|
|
4
|
+
export { default as evaluation } from '/app/test_workflows/dist/workflows/evaluation/workflow.js';
|
|
5
|
+
export { default as event_hub } from '/app/test_workflows/dist/workflows/event_hub/workflow.js';
|
|
6
|
+
export { default as execute_in_parallel } from '/app/test_workflows/dist/workflows/execute_in_parallel/workflow.js';
|
|
7
|
+
export { default as fetch } from '/app/test_workflows/dist/workflows/fetch/workflow.js';
|
|
8
|
+
export { default as get_context } from '/app/test_workflows/dist/workflows/get_context/workflow.js';
|
|
9
|
+
export { default as helper_fn } from '/app/test_workflows/dist/workflows/helper_fn/workflow.js';
|
|
10
|
+
export { default as http } from '/app/test_workflows/dist/workflows/http/workflow.js';
|
|
11
|
+
export { default as http_error } from '/app/test_workflows/dist/workflows/http_error/workflow.js';
|
|
12
|
+
export { default as http_simple } from '/app/test_workflows/dist/workflows/http_simple/workflow.js';
|
|
13
|
+
export { default as invalid_schema } from '/app/test_workflows/dist/workflows/invalid_schema/workflow.js';
|
|
14
|
+
export { default as agent_demo } from '/app/test_workflows/dist/workflows/llm/agent_demo/workflow.js';
|
|
15
|
+
export { default as blog_generator_eval } from '/app/test_workflows/dist/workflows/llm/blog_generator/tests/evals/workflow.js';
|
|
16
|
+
export { default as blog_generator } from '/app/test_workflows/dist/workflows/llm/blog_generator/workflow.js';
|
|
17
|
+
export { default as generate_image } from '/app/test_workflows/dist/workflows/llm/generate_image/workflow.js';
|
|
18
|
+
export { default as generate_text } from '/app/test_workflows/dist/workflows/llm/generate_text/workflow.js';
|
|
19
|
+
export { default as stream_text } from '/app/test_workflows/dist/workflows/llm/stream_text/workflow.js';
|
|
20
|
+
export { default as web_search } from '/app/test_workflows/dist/workflows/llm/web_search/workflow.js';
|
|
21
|
+
export { default as call_shape_child } from '/app/test_workflows/dist/workflows/nested/call_shapes/child/workflow.js';
|
|
22
|
+
export { default as call_shape_child_no_args } from '/app/test_workflows/dist/workflows/nested/call_shapes/child_no_args/workflow.js';
|
|
23
|
+
export { default as call_shape_child_sleep } from '/app/test_workflows/dist/workflows/nested/call_shapes/child_sleep/workflow.js';
|
|
24
|
+
export { default as nested_call_shapes } from '/app/test_workflows/dist/workflows/nested/call_shapes/workflow.js';
|
|
25
|
+
export { default as nested_continue_as_new_child } from '/app/test_workflows/dist/workflows/nested/continue_as_new/child/workflow.js';
|
|
26
|
+
export { default as nested_continue_as_new } from '/app/test_workflows/dist/workflows/nested/continue_as_new/workflow.js';
|
|
27
|
+
export { default as nested_direct_call_child } from '/app/test_workflows/dist/workflows/nested/direct_call/child/workflow.js';
|
|
28
|
+
export { default as nested_direct_call } from '/app/test_workflows/dist/workflows/nested/direct_call/workflow.js';
|
|
29
|
+
export { default as nested_external } from '/app/test_workflows/dist/workflows/nested/external/workflow.js';
|
|
30
|
+
export { default as nested_fatal_error_child } from '/app/test_workflows/dist/workflows/nested/fatal_error/child/workflow.js';
|
|
31
|
+
export { default as nested_fatal_error } from '/app/test_workflows/dist/workflows/nested/fatal_error/workflow.js';
|
|
32
|
+
export { default as nested_http_error_child } from '/app/test_workflows/dist/workflows/nested/http_error/child/workflow.js';
|
|
33
|
+
export { default as nested_http_error } from '/app/test_workflows/dist/workflows/nested/http_error/workflow.js';
|
|
34
|
+
export { default as nested_indirect_call_child } from '/app/test_workflows/dist/workflows/nested/indirect_call/child/workflow.js';
|
|
35
|
+
export { default as nested_indirect_call } from '/app/test_workflows/dist/workflows/nested/indirect_call/workflow.js';
|
|
36
|
+
export { default as nested_recursive } from '/app/test_workflows/dist/workflows/nested/recursive/workflow.js';
|
|
37
|
+
export { default as nested_shared_child } from '/app/test_workflows/dist/workflows/nested/shared_test/child/workflow.js';
|
|
38
|
+
export { default as nested_shared } from '/app/test_workflows/dist/workflows/nested/shared_test/workflow.js';
|
|
39
|
+
export { default as send_http_request } from '/app/test_workflows/dist/workflows/send_http_request/workflow.js';
|
|
40
|
+
export { default as shared_demo } from '/app/test_workflows/dist/workflows/shared_demo/workflow.js';
|
|
41
|
+
export { default as signals } from '/app/test_workflows/dist/workflows/signals/workflow.js';
|
|
42
|
+
export { default as simple_eval } from '/app/test_workflows/dist/workflows/simple/tests/evals/workflow.js';
|
|
43
|
+
export { default as simple } from '/app/test_workflows/dist/workflows/simple/workflow.js';
|
|
44
|
+
export { default as simple_alias_eval } from '/app/test_workflows/dist/workflows/simple_alias/tests/evals/workflow.js';
|
|
45
|
+
export { default as simple_alias } from '/app/test_workflows/dist/workflows/simple_alias/workflow.js';
|
|
46
|
+
export { default as sleep } from '/app/test_workflows/dist/workflows/simple_sleep/workflow.js';
|
|
47
|
+
export { default as slow } from '/app/test_workflows/dist/workflows/slow/workflow.js';
|
|
48
|
+
export { default as webhook } from '/app/test_workflows/dist/workflows/webhook/workflow.js';
|
|
49
|
+
export { default as __process_numbers } from '/app/node_modules/.pnpm/@growthxlabs+workflows_catalog@0.0.13_@outputai+core@sdk+core_zod@4.3.6/node_modules/@growthxlabs/workflows_catalog/src/workflows/process_numbers/workflow.js';
|
|
50
|
+
export { default as __subtract_numbers } from '/app/node_modules/.pnpm/@growthxlabs+workflows_catalog@0.0.13_@outputai+core@sdk+core_zod@4.3.6/node_modules/@growthxlabs/workflows_catalog/src/workflows/subtract_numbers/workflow.js';
|
|
51
|
+
export { default as __sum_numbers } from '/app/node_modules/.pnpm/@growthxlabs+workflows_catalog@0.0.13_@outputai+core@sdk+core_zod@4.3.6/node_modules/@growthxlabs/workflows_catalog/src/workflows/sum_numbers/workflow.js';
|
|
52
|
+
export { default as simple_v1 } from '/app/test_workflows/dist/workflows/simple_alias/workflow.js';
|
|
53
|
+
export { default as simple_original } from '/app/test_workflows/dist/workflows/simple_alias/workflow.js';
|
|
54
|
+
export { default as $catalog } from 'file:///app/sdk/core/src/worker/catalog_workflow/workflow.js';
|