@voltagent/server-core 1.0.30 → 1.0.32

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.
@@ -347,6 +347,32 @@ declare const WORKFLOW_ROUTES: {
347
347
  };
348
348
  };
349
349
  };
350
+ readonly listWorkflowRuns: {
351
+ readonly method: "get";
352
+ readonly path: "/workflows/executions";
353
+ readonly summary: "List workflow executions (query-driven)";
354
+ readonly description: "Retrieve workflow executions using query params (workflowId, status, from, to, limit, offset) without path parameters.";
355
+ readonly tags: readonly ["Workflow Management"];
356
+ readonly operationId: "listWorkflowRuns";
357
+ readonly responses: {
358
+ readonly 200: {
359
+ readonly description: "Successfully retrieved workflow executions";
360
+ readonly contentType: "application/json";
361
+ };
362
+ readonly 400: {
363
+ readonly description: "Invalid query parameters";
364
+ readonly contentType: "application/json";
365
+ };
366
+ readonly 404: {
367
+ readonly description: "Workflow not found";
368
+ readonly contentType: "application/json";
369
+ };
370
+ readonly 500: {
371
+ readonly description: "Failed to retrieve workflow executions due to server error";
372
+ readonly contentType: "application/json";
373
+ };
374
+ };
375
+ };
350
376
  readonly executeWorkflow: {
351
377
  readonly method: "post";
352
378
  readonly path: "/workflows/:id/execute";
@@ -1269,6 +1295,32 @@ declare const ALL_ROUTES: {
1269
1295
  };
1270
1296
  };
1271
1297
  };
1298
+ readonly listWorkflowRuns: {
1299
+ readonly method: "get";
1300
+ readonly path: "/workflows/executions";
1301
+ readonly summary: "List workflow executions (query-driven)";
1302
+ readonly description: "Retrieve workflow executions using query params (workflowId, status, from, to, limit, offset) without path parameters.";
1303
+ readonly tags: readonly ["Workflow Management"];
1304
+ readonly operationId: "listWorkflowRuns";
1305
+ readonly responses: {
1306
+ readonly 200: {
1307
+ readonly description: "Successfully retrieved workflow executions";
1308
+ readonly contentType: "application/json";
1309
+ };
1310
+ readonly 400: {
1311
+ readonly description: "Invalid query parameters";
1312
+ readonly contentType: "application/json";
1313
+ };
1314
+ readonly 404: {
1315
+ readonly description: "Workflow not found";
1316
+ readonly contentType: "application/json";
1317
+ };
1318
+ readonly 500: {
1319
+ readonly description: "Failed to retrieve workflow executions due to server error";
1320
+ readonly contentType: "application/json";
1321
+ };
1322
+ };
1323
+ };
1272
1324
  readonly executeWorkflow: {
1273
1325
  readonly method: "post";
1274
1326
  readonly path: "/workflows/:id/execute";
@@ -2079,6 +2131,17 @@ declare function handleCancelWorkflow(executionId: string, body: any, deps: Serv
2079
2131
  * Returns resume result
2080
2132
  */
2081
2133
  declare function handleResumeWorkflow(workflowId: string, executionId: string, body: any, deps: ServerProviderDeps, logger: Logger): Promise<ApiResponse>;
2134
+ /**
2135
+ * Handler for listing workflow execution runs
2136
+ */
2137
+ declare function handleListWorkflowRuns(workflowId: string | undefined, query: {
2138
+ status?: string;
2139
+ from?: string;
2140
+ to?: string;
2141
+ limit?: string;
2142
+ offset?: string;
2143
+ workflowId?: string;
2144
+ } | undefined, deps: ServerProviderDeps, logger: Logger): Promise<ApiResponse>;
2082
2145
  /**
2083
2146
  * Handler for getting workflow execution state
2084
2147
  * Returns workflow state from Memory V2
@@ -2226,4 +2289,4 @@ declare function mapHandlerResponse(response: ApiResponse, type?: string): ApiRe
2226
2289
  */
2227
2290
  declare function getResponseStatus(response: ApiResponse): number;
2228
2291
 
2229
- export { handleGenerateObject as $, type ApiResponse as A, type JsonRpcStream as B, type JsonRpcHandlerResult as C, type JsonRpcRequest as D, type ErrorResponse as E, type A2ARequestContext as F, type AgentCardSkill as G, type HttpMethod as H, type AgentCardProviderInfo as I, type JsonRpcError as J, type AgentCardCapabilities as K, LOG_ROUTES as L, type MemoryUserSummary as M, type AgentCard as N, OBSERVABILITY_ROUTES as O, A2AErrorCode as P, normalizeError as Q, type ResponseDefinition as R, type SuccessResponse as S, isJsonRpcRequest as T, UPDATE_ROUTES as U, VoltA2AError as V, WORKFLOW_ROUTES as W, handleGetAgents as X, handleGenerateText as Y, handleStreamText as Z, handleChatStream as _, type A2AServerLikeWithHandlers as a, handleStreamObject as a0, handleGetAgent as a1, handleGetAgentHistory as a2, handleGetWorkflows as a3, handleGetWorkflow as a4, handleExecuteWorkflow as a5, handleStreamWorkflow as a6, handleSuspendWorkflow as a7, handleCancelWorkflow as a8, handleResumeWorkflow as a9, handleGetWorkflowState as aa, type LogFilterOptions as ab, type LogHandlerResponse as ac, handleGetLogs as ad, listMemoryUsersHandler as ae, listMemoryConversationsHandler as af, getConversationMessagesHandler as ag, getConversationStepsHandler as ah, getWorkingMemoryHandler as ai, mapLogResponse as aj, mapHandlerResponse as ak, getResponseStatus as al, type OpenApiInfo as am, type AppSetupConfig as an, getOrCreateLogger as ao, shouldEnableSwaggerUI as ap, getOpenApiDoc as aq, DEFAULT_CORS_OPTIONS as ar, type StreamResponse as b, isSuccessResponse as c, type MemoryUserAgentSummary as d, type MemoryConversationSummary as e, type MemoryConversationMessagesResult as f, type MemoryConversationStepsResult as g, type MemoryWorkingMemoryResult as h, isErrorResponse as i, type MemoryListUsersQuery as j, type MemoryListConversationsQuery as k, type MemoryGetMessagesQuery as l, type MemoryGetStepsQuery as m, type RouteDefinition as n, AGENT_ROUTES as o, OBSERVABILITY_MEMORY_ROUTES as p, ALL_ROUTES as q, getAllRoutesArray as r, MCP_ROUTES as s, A2A_ROUTES as t, getRoutesByTag as u, parseJsonRpcRequest as v, resolveAgentCard as w, executeA2ARequest as x, type A2AJsonRpcId as y, type JsonRpcResponse as z };
2292
+ export { handleGenerateObject as $, type ApiResponse as A, type JsonRpcStream as B, type JsonRpcHandlerResult as C, type JsonRpcRequest as D, type ErrorResponse as E, type A2ARequestContext as F, type AgentCardSkill as G, type HttpMethod as H, type AgentCardProviderInfo as I, type JsonRpcError as J, type AgentCardCapabilities as K, LOG_ROUTES as L, type MemoryUserSummary as M, type AgentCard as N, OBSERVABILITY_ROUTES as O, A2AErrorCode as P, normalizeError as Q, type ResponseDefinition as R, type SuccessResponse as S, isJsonRpcRequest as T, UPDATE_ROUTES as U, VoltA2AError as V, WORKFLOW_ROUTES as W, handleGetAgents as X, handleGenerateText as Y, handleStreamText as Z, handleChatStream as _, type A2AServerLikeWithHandlers as a, handleStreamObject as a0, handleGetAgent as a1, handleGetAgentHistory as a2, handleGetWorkflows as a3, handleGetWorkflow as a4, handleExecuteWorkflow as a5, handleStreamWorkflow as a6, handleSuspendWorkflow as a7, handleCancelWorkflow as a8, handleResumeWorkflow as a9, handleListWorkflowRuns as aa, handleGetWorkflowState as ab, type LogFilterOptions as ac, type LogHandlerResponse as ad, handleGetLogs as ae, listMemoryUsersHandler as af, listMemoryConversationsHandler as ag, getConversationMessagesHandler as ah, getConversationStepsHandler as ai, getWorkingMemoryHandler as aj, mapLogResponse as ak, mapHandlerResponse as al, getResponseStatus as am, type OpenApiInfo as an, type AppSetupConfig as ao, getOrCreateLogger as ap, shouldEnableSwaggerUI as aq, getOpenApiDoc as ar, DEFAULT_CORS_OPTIONS as as, type StreamResponse as b, isSuccessResponse as c, type MemoryUserAgentSummary as d, type MemoryConversationSummary as e, type MemoryConversationMessagesResult as f, type MemoryConversationStepsResult as g, type MemoryWorkingMemoryResult as h, isErrorResponse as i, type MemoryListUsersQuery as j, type MemoryListConversationsQuery as k, type MemoryGetMessagesQuery as l, type MemoryGetStepsQuery as m, type RouteDefinition as n, AGENT_ROUTES as o, OBSERVABILITY_MEMORY_ROUTES as p, ALL_ROUTES as q, getAllRoutesArray as r, MCP_ROUTES as s, A2A_ROUTES as t, getRoutesByTag as u, parseJsonRpcRequest as v, resolveAgentCard as w, executeA2ARequest as x, type A2AJsonRpcId as y, type JsonRpcResponse as z };
@@ -347,6 +347,32 @@ declare const WORKFLOW_ROUTES: {
347
347
  };
348
348
  };
349
349
  };
350
+ readonly listWorkflowRuns: {
351
+ readonly method: "get";
352
+ readonly path: "/workflows/executions";
353
+ readonly summary: "List workflow executions (query-driven)";
354
+ readonly description: "Retrieve workflow executions using query params (workflowId, status, from, to, limit, offset) without path parameters.";
355
+ readonly tags: readonly ["Workflow Management"];
356
+ readonly operationId: "listWorkflowRuns";
357
+ readonly responses: {
358
+ readonly 200: {
359
+ readonly description: "Successfully retrieved workflow executions";
360
+ readonly contentType: "application/json";
361
+ };
362
+ readonly 400: {
363
+ readonly description: "Invalid query parameters";
364
+ readonly contentType: "application/json";
365
+ };
366
+ readonly 404: {
367
+ readonly description: "Workflow not found";
368
+ readonly contentType: "application/json";
369
+ };
370
+ readonly 500: {
371
+ readonly description: "Failed to retrieve workflow executions due to server error";
372
+ readonly contentType: "application/json";
373
+ };
374
+ };
375
+ };
350
376
  readonly executeWorkflow: {
351
377
  readonly method: "post";
352
378
  readonly path: "/workflows/:id/execute";
@@ -1269,6 +1295,32 @@ declare const ALL_ROUTES: {
1269
1295
  };
1270
1296
  };
1271
1297
  };
1298
+ readonly listWorkflowRuns: {
1299
+ readonly method: "get";
1300
+ readonly path: "/workflows/executions";
1301
+ readonly summary: "List workflow executions (query-driven)";
1302
+ readonly description: "Retrieve workflow executions using query params (workflowId, status, from, to, limit, offset) without path parameters.";
1303
+ readonly tags: readonly ["Workflow Management"];
1304
+ readonly operationId: "listWorkflowRuns";
1305
+ readonly responses: {
1306
+ readonly 200: {
1307
+ readonly description: "Successfully retrieved workflow executions";
1308
+ readonly contentType: "application/json";
1309
+ };
1310
+ readonly 400: {
1311
+ readonly description: "Invalid query parameters";
1312
+ readonly contentType: "application/json";
1313
+ };
1314
+ readonly 404: {
1315
+ readonly description: "Workflow not found";
1316
+ readonly contentType: "application/json";
1317
+ };
1318
+ readonly 500: {
1319
+ readonly description: "Failed to retrieve workflow executions due to server error";
1320
+ readonly contentType: "application/json";
1321
+ };
1322
+ };
1323
+ };
1272
1324
  readonly executeWorkflow: {
1273
1325
  readonly method: "post";
1274
1326
  readonly path: "/workflows/:id/execute";
@@ -2079,6 +2131,17 @@ declare function handleCancelWorkflow(executionId: string, body: any, deps: Serv
2079
2131
  * Returns resume result
2080
2132
  */
2081
2133
  declare function handleResumeWorkflow(workflowId: string, executionId: string, body: any, deps: ServerProviderDeps, logger: Logger): Promise<ApiResponse>;
2134
+ /**
2135
+ * Handler for listing workflow execution runs
2136
+ */
2137
+ declare function handleListWorkflowRuns(workflowId: string | undefined, query: {
2138
+ status?: string;
2139
+ from?: string;
2140
+ to?: string;
2141
+ limit?: string;
2142
+ offset?: string;
2143
+ workflowId?: string;
2144
+ } | undefined, deps: ServerProviderDeps, logger: Logger): Promise<ApiResponse>;
2082
2145
  /**
2083
2146
  * Handler for getting workflow execution state
2084
2147
  * Returns workflow state from Memory V2
@@ -2226,4 +2289,4 @@ declare function mapHandlerResponse(response: ApiResponse, type?: string): ApiRe
2226
2289
  */
2227
2290
  declare function getResponseStatus(response: ApiResponse): number;
2228
2291
 
2229
- export { handleGenerateObject as $, type ApiResponse as A, type JsonRpcStream as B, type JsonRpcHandlerResult as C, type JsonRpcRequest as D, type ErrorResponse as E, type A2ARequestContext as F, type AgentCardSkill as G, type HttpMethod as H, type AgentCardProviderInfo as I, type JsonRpcError as J, type AgentCardCapabilities as K, LOG_ROUTES as L, type MemoryUserSummary as M, type AgentCard as N, OBSERVABILITY_ROUTES as O, A2AErrorCode as P, normalizeError as Q, type ResponseDefinition as R, type SuccessResponse as S, isJsonRpcRequest as T, UPDATE_ROUTES as U, VoltA2AError as V, WORKFLOW_ROUTES as W, handleGetAgents as X, handleGenerateText as Y, handleStreamText as Z, handleChatStream as _, type A2AServerLikeWithHandlers as a, handleStreamObject as a0, handleGetAgent as a1, handleGetAgentHistory as a2, handleGetWorkflows as a3, handleGetWorkflow as a4, handleExecuteWorkflow as a5, handleStreamWorkflow as a6, handleSuspendWorkflow as a7, handleCancelWorkflow as a8, handleResumeWorkflow as a9, handleGetWorkflowState as aa, type LogFilterOptions as ab, type LogHandlerResponse as ac, handleGetLogs as ad, listMemoryUsersHandler as ae, listMemoryConversationsHandler as af, getConversationMessagesHandler as ag, getConversationStepsHandler as ah, getWorkingMemoryHandler as ai, mapLogResponse as aj, mapHandlerResponse as ak, getResponseStatus as al, type OpenApiInfo as am, type AppSetupConfig as an, getOrCreateLogger as ao, shouldEnableSwaggerUI as ap, getOpenApiDoc as aq, DEFAULT_CORS_OPTIONS as ar, type StreamResponse as b, isSuccessResponse as c, type MemoryUserAgentSummary as d, type MemoryConversationSummary as e, type MemoryConversationMessagesResult as f, type MemoryConversationStepsResult as g, type MemoryWorkingMemoryResult as h, isErrorResponse as i, type MemoryListUsersQuery as j, type MemoryListConversationsQuery as k, type MemoryGetMessagesQuery as l, type MemoryGetStepsQuery as m, type RouteDefinition as n, AGENT_ROUTES as o, OBSERVABILITY_MEMORY_ROUTES as p, ALL_ROUTES as q, getAllRoutesArray as r, MCP_ROUTES as s, A2A_ROUTES as t, getRoutesByTag as u, parseJsonRpcRequest as v, resolveAgentCard as w, executeA2ARequest as x, type A2AJsonRpcId as y, type JsonRpcResponse as z };
2292
+ export { handleGenerateObject as $, type ApiResponse as A, type JsonRpcStream as B, type JsonRpcHandlerResult as C, type JsonRpcRequest as D, type ErrorResponse as E, type A2ARequestContext as F, type AgentCardSkill as G, type HttpMethod as H, type AgentCardProviderInfo as I, type JsonRpcError as J, type AgentCardCapabilities as K, LOG_ROUTES as L, type MemoryUserSummary as M, type AgentCard as N, OBSERVABILITY_ROUTES as O, A2AErrorCode as P, normalizeError as Q, type ResponseDefinition as R, type SuccessResponse as S, isJsonRpcRequest as T, UPDATE_ROUTES as U, VoltA2AError as V, WORKFLOW_ROUTES as W, handleGetAgents as X, handleGenerateText as Y, handleStreamText as Z, handleChatStream as _, type A2AServerLikeWithHandlers as a, handleStreamObject as a0, handleGetAgent as a1, handleGetAgentHistory as a2, handleGetWorkflows as a3, handleGetWorkflow as a4, handleExecuteWorkflow as a5, handleStreamWorkflow as a6, handleSuspendWorkflow as a7, handleCancelWorkflow as a8, handleResumeWorkflow as a9, handleListWorkflowRuns as aa, handleGetWorkflowState as ab, type LogFilterOptions as ac, type LogHandlerResponse as ad, handleGetLogs as ae, listMemoryUsersHandler as af, listMemoryConversationsHandler as ag, getConversationMessagesHandler as ah, getConversationStepsHandler as ai, getWorkingMemoryHandler as aj, mapLogResponse as ak, mapHandlerResponse as al, getResponseStatus as am, type OpenApiInfo as an, type AppSetupConfig as ao, getOrCreateLogger as ap, shouldEnableSwaggerUI as aq, getOpenApiDoc as ar, DEFAULT_CORS_OPTIONS as as, type StreamResponse as b, isSuccessResponse as c, type MemoryUserAgentSummary as d, type MemoryConversationSummary as e, type MemoryConversationMessagesResult as f, type MemoryConversationStepsResult as g, type MemoryWorkingMemoryResult as h, isErrorResponse as i, type MemoryListUsersQuery as j, type MemoryListConversationsQuery as k, type MemoryGetMessagesQuery as l, type MemoryGetStepsQuery as m, type RouteDefinition as n, AGENT_ROUTES as o, OBSERVABILITY_MEMORY_ROUTES as p, ALL_ROUTES as q, getAllRoutesArray as r, MCP_ROUTES as s, A2A_ROUTES as t, getRoutesByTag as u, parseJsonRpcRequest as v, resolveAgentCard as w, executeA2ARequest as x, type A2AJsonRpcId as y, type JsonRpcResponse as z };
package/dist/edge.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- export { F as A2ARequestContext, t as A2A_ROUTES, o as AGENT_ROUTES, L as LOG_ROUTES, p as OBSERVABILITY_MEMORY_ROUTES, O as OBSERVABILITY_ROUTES, W as WORKFLOW_ROUTES, x as executeA2ARequest, ag as getConversationMessagesHandler, ah as getConversationStepsHandler, ao as getOrCreateLogger, ai as getWorkingMemoryHandler, _ as handleChatStream, a5 as handleExecuteWorkflow, $ as handleGenerateObject, Y as handleGenerateText, a1 as handleGetAgent, a2 as handleGetAgentHistory, X as handleGetAgents, ad as handleGetLogs, a4 as handleGetWorkflow, aa as handleGetWorkflowState, a3 as handleGetWorkflows, a9 as handleResumeWorkflow, a0 as handleStreamObject, Z as handleStreamText, a6 as handleStreamWorkflow, a7 as handleSuspendWorkflow, i as isErrorResponse, af as listMemoryConversationsHandler, ae as listMemoryUsersHandler, aj as mapLogResponse, v as parseJsonRpcRequest, w as resolveAgentCard } from './edge-CtOnFGMl.mjs';
1
+ export { F as A2ARequestContext, t as A2A_ROUTES, o as AGENT_ROUTES, L as LOG_ROUTES, p as OBSERVABILITY_MEMORY_ROUTES, O as OBSERVABILITY_ROUTES, W as WORKFLOW_ROUTES, x as executeA2ARequest, ah as getConversationMessagesHandler, ai as getConversationStepsHandler, ap as getOrCreateLogger, aj as getWorkingMemoryHandler, _ as handleChatStream, a5 as handleExecuteWorkflow, $ as handleGenerateObject, Y as handleGenerateText, a1 as handleGetAgent, a2 as handleGetAgentHistory, X as handleGetAgents, ae as handleGetLogs, a4 as handleGetWorkflow, ab as handleGetWorkflowState, a3 as handleGetWorkflows, aa as handleListWorkflowRuns, a9 as handleResumeWorkflow, a0 as handleStreamObject, Z as handleStreamText, a6 as handleStreamWorkflow, a7 as handleSuspendWorkflow, i as isErrorResponse, ag as listMemoryConversationsHandler, af as listMemoryUsersHandler, ak as mapLogResponse, v as parseJsonRpcRequest, w as resolveAgentCard } from './edge-DNggrEBU.mjs';
2
2
  import '@voltagent/core';
3
3
  import '@voltagent/internal';
4
4
  import 'ai';
package/dist/edge.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { F as A2ARequestContext, t as A2A_ROUTES, o as AGENT_ROUTES, L as LOG_ROUTES, p as OBSERVABILITY_MEMORY_ROUTES, O as OBSERVABILITY_ROUTES, W as WORKFLOW_ROUTES, x as executeA2ARequest, ag as getConversationMessagesHandler, ah as getConversationStepsHandler, ao as getOrCreateLogger, ai as getWorkingMemoryHandler, _ as handleChatStream, a5 as handleExecuteWorkflow, $ as handleGenerateObject, Y as handleGenerateText, a1 as handleGetAgent, a2 as handleGetAgentHistory, X as handleGetAgents, ad as handleGetLogs, a4 as handleGetWorkflow, aa as handleGetWorkflowState, a3 as handleGetWorkflows, a9 as handleResumeWorkflow, a0 as handleStreamObject, Z as handleStreamText, a6 as handleStreamWorkflow, a7 as handleSuspendWorkflow, i as isErrorResponse, af as listMemoryConversationsHandler, ae as listMemoryUsersHandler, aj as mapLogResponse, v as parseJsonRpcRequest, w as resolveAgentCard } from './edge-CtOnFGMl.js';
1
+ export { F as A2ARequestContext, t as A2A_ROUTES, o as AGENT_ROUTES, L as LOG_ROUTES, p as OBSERVABILITY_MEMORY_ROUTES, O as OBSERVABILITY_ROUTES, W as WORKFLOW_ROUTES, x as executeA2ARequest, ah as getConversationMessagesHandler, ai as getConversationStepsHandler, ap as getOrCreateLogger, aj as getWorkingMemoryHandler, _ as handleChatStream, a5 as handleExecuteWorkflow, $ as handleGenerateObject, Y as handleGenerateText, a1 as handleGetAgent, a2 as handleGetAgentHistory, X as handleGetAgents, ae as handleGetLogs, a4 as handleGetWorkflow, ab as handleGetWorkflowState, a3 as handleGetWorkflows, aa as handleListWorkflowRuns, a9 as handleResumeWorkflow, a0 as handleStreamObject, Z as handleStreamText, a6 as handleStreamWorkflow, a7 as handleSuspendWorkflow, i as isErrorResponse, ag as listMemoryConversationsHandler, af as listMemoryUsersHandler, ak as mapLogResponse, v as parseJsonRpcRequest, w as resolveAgentCard } from './edge-DNggrEBU.js';
2
2
  import '@voltagent/core';
3
3
  import '@voltagent/internal';
4
4
  import 'ai';
package/dist/edge.js CHANGED
@@ -43,6 +43,7 @@ __export(edge_exports, {
43
43
  handleGetWorkflow: () => handleGetWorkflow,
44
44
  handleGetWorkflowState: () => handleGetWorkflowState,
45
45
  handleGetWorkflows: () => handleGetWorkflows,
46
+ handleListWorkflowRuns: () => handleListWorkflowRuns,
46
47
  handleResumeWorkflow: () => handleResumeWorkflow,
47
48
  handleStreamObject: () => handleStreamObject,
48
49
  handleStreamText: () => handleStreamText,
@@ -300,6 +301,32 @@ var WORKFLOW_ROUTES = {
300
301
  }
301
302
  }
302
303
  },
304
+ listWorkflowRuns: {
305
+ method: "get",
306
+ path: "/workflows/executions",
307
+ summary: "List workflow executions (query-driven)",
308
+ description: "Retrieve workflow executions using query params (workflowId, status, from, to, limit, offset) without path parameters.",
309
+ tags: ["Workflow Management"],
310
+ operationId: "listWorkflowRuns",
311
+ responses: {
312
+ 200: {
313
+ description: "Successfully retrieved workflow executions",
314
+ contentType: "application/json"
315
+ },
316
+ 400: {
317
+ description: "Invalid query parameters",
318
+ contentType: "application/json"
319
+ },
320
+ 404: {
321
+ description: "Workflow not found",
322
+ contentType: "application/json"
323
+ },
324
+ 500: {
325
+ description: "Failed to retrieve workflow executions due to server error",
326
+ contentType: "application/json"
327
+ }
328
+ }
329
+ },
303
330
  executeWorkflow: {
304
331
  method: "post",
305
332
  path: "/workflows/:id/execute",
@@ -1323,6 +1350,7 @@ async function handleGetWorkflow(workflowId, deps, logger) {
1323
1350
  }
1324
1351
  const registeredWorkflow = deps.workflowRegistry.getWorkflow(workflowId);
1325
1352
  let inputSchema = null;
1353
+ let resultSchema = null;
1326
1354
  let suspendSchema = null;
1327
1355
  let resumeSchema = null;
1328
1356
  if (registeredWorkflow?.inputSchema) {
@@ -1332,6 +1360,13 @@ async function handleGetWorkflow(workflowId, deps, logger) {
1332
1360
  logger.warn("Failed to convert input schema to JSON schema:", { error });
1333
1361
  }
1334
1362
  }
1363
+ if (registeredWorkflow?.resultSchema) {
1364
+ try {
1365
+ resultSchema = (0, import_core5.zodSchemaToJsonUI)(registeredWorkflow.resultSchema);
1366
+ } catch (error) {
1367
+ logger.warn("Failed to convert result schema to JSON schema:", { error });
1368
+ }
1369
+ }
1335
1370
  if (registeredWorkflow?.suspendSchema) {
1336
1371
  try {
1337
1372
  suspendSchema = (0, import_core5.zodSchemaToJsonUI)(registeredWorkflow.suspendSchema);
@@ -1394,6 +1429,7 @@ async function handleGetWorkflow(workflowId, deps, logger) {
1394
1429
  data: {
1395
1430
  ...workflowData,
1396
1431
  inputSchema,
1432
+ resultSchema,
1397
1433
  suspendSchema,
1398
1434
  resumeSchema
1399
1435
  }
@@ -1611,6 +1647,79 @@ async function handleResumeWorkflow(workflowId, executionId, body, deps, logger)
1611
1647
  }
1612
1648
  }
1613
1649
  __name(handleResumeWorkflow, "handleResumeWorkflow");
1650
+ function formatWorkflowState(workflowState) {
1651
+ return {
1652
+ ...workflowState,
1653
+ createdAt: workflowState.createdAt instanceof Date ? workflowState.createdAt.toISOString() : workflowState.createdAt,
1654
+ updatedAt: workflowState.updatedAt instanceof Date ? workflowState.updatedAt.toISOString() : workflowState.updatedAt,
1655
+ suspension: workflowState.suspension ? {
1656
+ ...workflowState.suspension,
1657
+ suspendedAt: workflowState.suspension.suspendedAt instanceof Date ? workflowState.suspension.suspendedAt.toISOString() : workflowState.suspension.suspendedAt
1658
+ } : void 0
1659
+ };
1660
+ }
1661
+ __name(formatWorkflowState, "formatWorkflowState");
1662
+ async function handleListWorkflowRuns(workflowId, query, deps, logger) {
1663
+ try {
1664
+ const effectiveWorkflowId = query?.workflowId ?? workflowId;
1665
+ const filters = {
1666
+ workflowId: effectiveWorkflowId,
1667
+ status: query?.status,
1668
+ limit: query?.limit ? Number(query.limit) : void 0,
1669
+ offset: query?.offset ? Number(query.offset) : void 0
1670
+ };
1671
+ if (query?.from) {
1672
+ const fromDate = new Date(query.from);
1673
+ if (!Number.isNaN(fromDate.getTime())) {
1674
+ filters.from = fromDate;
1675
+ }
1676
+ }
1677
+ if (query?.to) {
1678
+ const toDate = new Date(query.to);
1679
+ if (!Number.isNaN(toDate.getTime())) {
1680
+ filters.to = toDate;
1681
+ }
1682
+ }
1683
+ if (effectiveWorkflowId) {
1684
+ const registeredWorkflow = deps.workflowRegistry.getWorkflow(effectiveWorkflowId);
1685
+ if (!registeredWorkflow) {
1686
+ return {
1687
+ success: false,
1688
+ error: `Workflow with id ${effectiveWorkflowId} not found`
1689
+ };
1690
+ }
1691
+ const workflowStates = await registeredWorkflow.workflow.memory.queryWorkflowRuns(filters);
1692
+ const formattedStates2 = workflowStates.map((state) => formatWorkflowState(state));
1693
+ return {
1694
+ success: true,
1695
+ data: formattedStates2
1696
+ };
1697
+ }
1698
+ const allWorkflowIds = deps.workflowRegistry.getAllWorkflowIds?.() ?? [];
1699
+ const results = [];
1700
+ for (const id of allWorkflowIds) {
1701
+ const registeredWorkflow = deps.workflowRegistry.getWorkflow(id);
1702
+ if (!registeredWorkflow) continue;
1703
+ const states = await registeredWorkflow.workflow.memory.queryWorkflowRuns({
1704
+ ...filters,
1705
+ workflowId: id
1706
+ });
1707
+ results.push(...states);
1708
+ }
1709
+ const formattedStates = results.sort((a, b) => b.createdAt.getTime() - a.createdAt.getTime()).map((state) => formatWorkflowState(state));
1710
+ return {
1711
+ success: true,
1712
+ data: formattedStates
1713
+ };
1714
+ } catch (error) {
1715
+ logger.error("Failed to get workflow states", { error });
1716
+ return {
1717
+ success: false,
1718
+ error: error instanceof Error ? error.message : "Failed to get workflow states"
1719
+ };
1720
+ }
1721
+ }
1722
+ __name(handleListWorkflowRuns, "handleListWorkflowRuns");
1614
1723
  async function handleGetWorkflowState(workflowId, executionId, deps, logger) {
1615
1724
  try {
1616
1725
  const registeredWorkflow = deps.workflowRegistry.getWorkflow(workflowId);
@@ -1627,15 +1736,7 @@ async function handleGetWorkflowState(workflowId, executionId, deps, logger) {
1627
1736
  error: `Workflow execution state for ${executionId} not found`
1628
1737
  };
1629
1738
  }
1630
- const formattedState = {
1631
- ...workflowState,
1632
- createdAt: workflowState.createdAt instanceof Date ? workflowState.createdAt.toISOString() : workflowState.createdAt,
1633
- updatedAt: workflowState.updatedAt instanceof Date ? workflowState.updatedAt.toISOString() : workflowState.updatedAt,
1634
- suspension: workflowState.suspension ? {
1635
- ...workflowState.suspension,
1636
- suspendedAt: workflowState.suspension.suspendedAt instanceof Date ? workflowState.suspension.suspendedAt.toISOString() : workflowState.suspension.suspendedAt
1637
- } : void 0
1638
- };
1739
+ const formattedState = formatWorkflowState(workflowState);
1639
1740
  return {
1640
1741
  success: true,
1641
1742
  data: formattedState
@@ -2229,6 +2330,7 @@ __name(mapLogResponse, "mapLogResponse");
2229
2330
  handleGetWorkflow,
2230
2331
  handleGetWorkflowState,
2231
2332
  handleGetWorkflows,
2333
+ handleListWorkflowRuns,
2232
2334
  handleResumeWorkflow,
2233
2335
  handleStreamObject,
2234
2336
  handleStreamText,