Skip to content

Commit

Permalink
Better Cloud ListWorkflows (#543)
Browse files Browse the repository at this point in the history
ListWorkflows is now filterable by workflow UUID so you can retrieve a
specific workflow.
  • Loading branch information
kraftp authored Jul 10, 2024
1 parent d74ddab commit 7dba190
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions packages/dbos-cloud/applications/manage-workflows.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import axios, { AxiosError } from "axios";
import { handleAPIErrors, getCloudCredentials, getLogger, isCloudAPIErrorResponse, retrieveApplicationName } from "../cloudutils.js";

export interface ListWorkflowsInput {
workflow_uuids?: string[] // Specific workflow UUIDs to retrieve.
workflow_name?: string; // The name of the workflow function
authenticated_user?: string; // The user who ran the workflow.
start_time?: string; // Timestamp in ISO 8601 format
Expand Down
6 changes: 4 additions & 2 deletions packages/dbos-cloud/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -395,14 +395,16 @@ workflowCommands
.description('List workflows from your application')
.argument("[string]", "application name (Default: name from package.json)")
.option('-l, --limit <number>', 'Limit the results returned', "10")
.option('-u, --user <string>', 'Retrieve workflows run by this user')
.option('-u, --workflowUUIDs <uuid...>', 'Retrieve specific UUIDs')
.option('-U, --user <string>', 'Retrieve workflows run by this user')
.option('-s, --start-time <string>', 'Retrieve workflows starting after this timestamp (ISO 8601 format)')
.option('-e, --end-time <string>', 'Retrieve workflows starting before this timestamp (ISO 8601 format)')
.option('-S, --status <string>', 'Retrieve workflows with this status (PENDING, SUCCESS, ERROR, RETRIES_EXCEEDED, or CANCELLED)')
.option('-v, --application-version <string>', 'Retrieve workflows with this application version')
.action(async (appName: string | undefined, options: { limit?: string, appDir?: string, user?: string, startTime?: string, endTime?: string, status?: string, applicationVersion?: string }) => {
.action(async (appName: string | undefined, options: { limit?: string, appDir?: string, user?: string, startTime?: string, endTime?: string, status?: string, applicationVersion?: string, workflow_uuids?: string[] }) => {
const input: ListWorkflowsInput = {
limit: Number(options.limit),
workflow_uuids: options.workflow_uuids,
authenticated_user: options.user,
start_time: options.startTime,
end_time: options.endTime,
Expand Down

0 comments on commit 7dba190

Please sign in to comment.