Skip to content

Commit

Permalink
Start workflow runs instantly instead of showing a notification which… (
Browse files Browse the repository at this point in the history
  • Loading branch information
wintonzheng authored Jan 31, 2025
1 parent d218391 commit 5009355
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions skyvern-frontend/src/routes/workflows/RunWorkflowForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,10 @@ import { useCredentialGetter } from "@/hooks/useCredentialGetter";
import { copyText } from "@/util/copyText";
import { apiBaseUrl } from "@/util/env";
import { CopyIcon, PlayIcon, ReloadIcon } from "@radix-ui/react-icons";
import { ToastAction } from "@radix-ui/react-toast";
import { useMutation, useQueryClient } from "@tanstack/react-query";
import fetchToCurl from "fetch-to-curl";
import { useForm } from "react-hook-form";
import { Link, useParams } from "react-router-dom";
import { useNavigate, useParams } from "react-router-dom";
import { z } from "zod";
import { WorkflowParameter } from "./types/workflowTypes";
import { WorkflowParameterInput } from "./WorkflowParameterInput";
Expand Down Expand Up @@ -107,6 +106,7 @@ function RunWorkflowForm({
}: Props) {
const { workflowPermanentId } = useParams();
const credentialGetter = useCredentialGetter();
const navigate = useNavigate();
const queryClient = useQueryClient();
const form = useForm<RunWorkflowFormType>({
defaultValues: {
Expand All @@ -131,21 +131,13 @@ function RunWorkflowForm({
variant: "success",
title: "Workflow run started",
description: "The workflow run has been started successfully",
action: (
<ToastAction altText="View">
<Button asChild>
<Link
to={`/workflows/${workflowPermanentId}/${response.data.workflow_run_id}/overview`}
>
View
</Link>
</Button>
</ToastAction>
),
});
queryClient.invalidateQueries({
queryKey: ["workflowRuns"],
});
navigate(
`/workflows/${workflowPermanentId}/${response.data.workflow_run_id}/overview`,
);
},
onError: (error) => {
toast({
Expand Down

0 comments on commit 5009355

Please sign in to comment.