Skip to content

Automate browser based workflows with AI

Move Run Workflow button to top of page (#4626)

Suchintan1e29d3119a4f
diff --git a/skyvern-frontend/src/routes/workflows/RunWorkflowForm.tsx b/skyvern-frontend/src/routes/workflows/RunWorkflowForm.tsx
index 4bfebb274..a9c8e1180 100644
--- a/skyvern-frontend/src/routes/workflows/RunWorkflowForm.tsx
+++ b/skyvern-frontend/src/routes/workflows/RunWorkflowForm.tsx
@@ -504,6 +504,60 @@ function RunWorkflowForm({
onSubmit={form.handleSubmit(onSubmit, handleInvalid)}
className="space-y-8"
>
+ <header className="flex items-end justify-between gap-4">
+ <div className="space-y-5">
+ <h1 className="text-3xl">
+ Parameters{workflow?.title ? ` - ${workflow.title}` : ""}
+ </h1>
+ <h2 className="text-lg text-slate-400">
+ Fill the placeholder values that you have linked throughout your
+ workflow.
+ </h2>
+ </div>
+ <div className="flex shrink-0 gap-2">
+ <CopyApiCommandDropdown
+ getOptions={() => {
+ const values = form.getValues();
+ const body = getRunWorkflowRequestBody(
+ values,
+ workflowParameters,
+ );
+ const transformedBody = transformToWorkflowRunRequest(
+ body,
+ workflowPermanentId,
+ );
+
+ // Build headers - x-max-steps-override is optional and can be added manually if needed
+ const headers: Record<string, string> = {
+ "Content-Type": "application/json",
+ "x-api-key": apiCredential ?? "<your-api-key>",
+ };
+
+ return {
+ method: "POST",
+ url: `${runsApiBaseUrl}/run/workflows`,
+ body: transformedBody,
+ headers,
+ } satisfies ApiCommandOptions;
+ }}
+ />
+ <Button
+ type="submit"
+ disabled={
+ runWorkflowMutation.isPending || hasLoginBlockValidationError
+ }
+ >
+ {runWorkflowMutation.isPending && (
+ <ReloadIcon className="mr-2 h-4 w-4 animate-spin" />
+ )}
+ {!runWorkflowMutation.isPending && (
+ <PlayIcon className="mr-2 h-4 w-4" />
+ )}
+ Run workflow
+ </Button>
+ </div>
+ </header>
+
{hasLoginBlockValidationError && (
<Alert variant="destructive">
<ExclamationTriangleIcon className="h-4 w-4" />
@@ -1051,49 +1105,6 @@ function RunWorkflowForm({
</AccordionItem>
</Accordion>
</div>
-
- <div className="flex justify-end gap-2">
- <CopyApiCommandDropdown
- getOptions={() => {
- const values = form.getValues();
- const body = getRunWorkflowRequestBody(
- values,
- workflowParameters,
- );
- const transformedBody = transformToWorkflowRunRequest(
- body,
- workflowPermanentId,
- );
-
- // Build headers - x-max-steps-override is optional and can be added manually if needed
- const headers: Record<string, string> = {
- "Content-Type": "application/json",
- "x-api-key": apiCredential ?? "<your-api-key>",
- };
-
- return {
- method: "POST",
- url: `${runsApiBaseUrl}/run/workflows`,
- body: transformedBody,
- headers,
- } satisfies ApiCommandOptions;
- }}
- />
- <Button
- type="submit"
- disabled={
- runWorkflowMutation.isPending || hasLoginBlockValidationError
- }
- >
- {runWorkflowMutation.isPending && (
- <ReloadIcon className="mr-2 h-4 w-4 animate-spin" />
- )}
- {!runWorkflowMutation.isPending && (
- <PlayIcon className="mr-2 h-4 w-4" />
- )}
- Run workflow
- </Button>
- </div>
</form>
</Form>
);
diff --git a/skyvern-frontend/src/routes/workflows/WorkflowRunParameters.tsx b/skyvern-frontend/src/routes/workflows/WorkflowRunParameters.tsx
index 61dd25cfd..72660a33d 100644
--- a/skyvern-frontend/src/routes/workflows/WorkflowRunParameters.tsx
+++ b/skyvern-frontend/src/routes/workflows/WorkflowRunParameters.tsx
@@ -44,22 +44,16 @@ function WorkflowRunParameters() {
const initialValues = getInitialValues(location, workflowParameters ?? []);
- const header = (
- <header className="space-y-5">
- <h1 className="text-3xl">
- Parameters{workflow?.title ? ` - ${workflow.title}` : ""}
- </h1>
- <h2 className="text-lg text-slate-400">
- Fill the placeholder values that you have linked throughout your
- workflow.
- </h2>
- </header>
- );
-
if (isFetching) {
return (
<div className="space-y-8">
- {header}
+ <header className="space-y-5">
+ <h1 className="text-3xl">Parameters</h1>
+ <h2 className="text-lg text-slate-400">
+ Fill the placeholder values that you have linked throughout your
+ workflow.
+ </h2>
+ </header>
<Skeleton className="h-96 w-full" />
</div>
);
@@ -70,26 +64,21 @@ function WorkflowRunParameters() {
}
return (
- <div className="space-y-8">
- {header}
- <RunWorkflowForm
- initialValues={initialValues}
- workflowParameters={workflowParameters}
- initialSettings={{
- proxyLocation:
- proxyLocation ??
- workflow.proxy_location ??
- ProxyLocation.Residential,
- webhookCallbackUrl:
- webhookCallbackUrl ?? workflow.webhook_callback_url ?? "",
- maxScreenshotScrolls:
- maxScreenshotScrolls ?? workflow.max_screenshot_scrolls ?? null,
- extraHttpHeaders:
- extraHttpHeaders ?? workflow.extra_http_headers ?? null,
- cdpAddress: null,
- }}
- />
- </div>
+ <RunWorkflowForm
+ initialValues={initialValues}
+ workflowParameters={workflowParameters}
+ initialSettings={{
+ proxyLocation:
+ proxyLocation ?? workflow.proxy_location ?? ProxyLocation.Residential,
+ webhookCallbackUrl:
+ webhookCallbackUrl ?? workflow.webhook_callback_url ?? "",
+ maxScreenshotScrolls:
+ maxScreenshotScrolls ?? workflow.max_screenshot_scrolls ?? null,
+ extraHttpHeaders:
+ extraHttpHeaders ?? workflow.extra_http_headers ?? null,
+ cdpAddress: null,
+ }}
+ />
);
}