Skip to content

Commit

Permalink
Show downloaded files in workflow run (#1321)
Browse files Browse the repository at this point in the history
  • Loading branch information
wintonzheng authored Dec 4, 2024
1 parent 04d3a56 commit fc56299
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions skyvern-frontend/src/api/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ export type WorkflowRunStatusApiResponse = {
recording_url: string | null;
outputs: Record<string, unknown> | null;
failure_reason: string | null;
downloaded_file_urls: Array<string> | null;
};

export type TaskGenerationApiResponse = {
Expand Down
26 changes: 26 additions & 0 deletions skyvern-frontend/src/routes/workflows/WorkflowRun.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ import {
import { cn } from "@/util/utils";
import {
CopyIcon,
FileIcon,
Pencil2Icon,
PlayIcon,
ReaderIcon,
Expand Down Expand Up @@ -376,6 +377,8 @@ function WorkflowRun() {
</TableRow>
);

const fileUrls = workflowRun?.downloaded_file_urls ?? [];

return (
<div className="space-y-8">
<header className="flex justify-between">
Expand Down Expand Up @@ -625,6 +628,29 @@ function WorkflowRun() {
/>
</div>
)}
{workflowRunIsFinalized && (
<div className="space-y-4">
<header>
<h2 className="text-lg font-semibold">Downloaded Files</h2>
</header>
<div className="space-y-2">
{fileUrls.length > 0 ? (
fileUrls.map((url) => {
return (
<div key={url} className="flex gap-2">
<FileIcon className="size-6" />
<a href={url} className="underline underline-offset-4">
<span>{url}</span>
</a>
</div>
);
})
) : (
<div>No files downloaded</div>
)}
</div>
</div>
)}
{Object.entries(parameters).length > 0 && (
<div className="space-y-4">
<header>
Expand Down

0 comments on commit fc56299

Please sign in to comment.