migrate generate_script -> run_with (FE) (#3555)
This commit is contained in:
@@ -206,7 +206,7 @@ function RunWorkflowForm({
|
||||
extraHttpHeaders: initialSettings.extraHttpHeaders
|
||||
? JSON.stringify(initialSettings.extraHttpHeaders)
|
||||
: null,
|
||||
runWithCode: workflow?.generate_script ?? false,
|
||||
runWithCode: workflow?.run_with === "code",
|
||||
aiFallback: workflow?.ai_fallback ?? true,
|
||||
},
|
||||
});
|
||||
|
||||
@@ -50,7 +50,7 @@ const emptyWorkflowRequest: WorkflowCreateYAMLRequest = {
|
||||
title: "New Workflow",
|
||||
description: "",
|
||||
ai_fallback: true,
|
||||
generate_script: false,
|
||||
run_with: "agent",
|
||||
workflow_definition: {
|
||||
blocks: [],
|
||||
parameters: [],
|
||||
|
||||
@@ -124,7 +124,7 @@ function getWorkflowElements(version: WorkflowVersion) {
|
||||
extraHttpHeaders: version.extra_http_headers
|
||||
? JSON.stringify(version.extra_http_headers)
|
||||
: null,
|
||||
useScriptCache: version.generate_script,
|
||||
runWith: version.run_with,
|
||||
scriptCacheKey: version.cache_key,
|
||||
aiFallback: version.ai_fallback ?? true,
|
||||
runSequentially: version.run_sequentially ?? false,
|
||||
|
||||
@@ -61,7 +61,7 @@ function Debugger() {
|
||||
extraHttpHeaders: workflow.extra_http_headers
|
||||
? JSON.stringify(workflow.extra_http_headers)
|
||||
: null,
|
||||
useScriptCache: workflow.generate_script,
|
||||
runWith: workflow.run_with,
|
||||
scriptCacheKey: workflow.cache_key,
|
||||
aiFallback: workflow.ai_fallback ?? true,
|
||||
runSequentially: workflow.run_sequentially ?? false,
|
||||
|
||||
@@ -62,7 +62,7 @@ function WorkflowEditor() {
|
||||
extraHttpHeaders: workflow.extra_http_headers
|
||||
? JSON.stringify(workflow.extra_http_headers)
|
||||
: null,
|
||||
useScriptCache: workflow.generate_script,
|
||||
runWith: workflow.run_with,
|
||||
scriptCacheKey: workflow.cache_key,
|
||||
aiFallback: workflow.ai_fallback ?? true,
|
||||
runSequentially: workflow.run_sequentially ?? false,
|
||||
|
||||
@@ -720,7 +720,7 @@ function Workspace({
|
||||
extraHttpHeaders: selectedVersion.extra_http_headers
|
||||
? JSON.stringify(selectedVersion.extra_http_headers)
|
||||
: null,
|
||||
useScriptCache: selectedVersion.generate_script,
|
||||
runWith: selectedVersion.run_with,
|
||||
scriptCacheKey: selectedVersion.cache_key,
|
||||
aiFallback: selectedVersion.ai_fallback ?? true,
|
||||
runSequentially: selectedVersion.run_sequentially ?? false,
|
||||
|
||||
@@ -79,7 +79,7 @@ function StartNode({ id, data }: NodeProps<StartNode>) {
|
||||
? data.maxScreenshotScrolls
|
||||
: null,
|
||||
extraHttpHeaders: data.withWorkflowSettings ? data.extraHttpHeaders : null,
|
||||
useScriptCache: data.withWorkflowSettings ? data.useScriptCache : false,
|
||||
runWith: data.withWorkflowSettings ? data.runWith : "agent",
|
||||
scriptCacheKey: data.withWorkflowSettings ? data.scriptCacheKey : null,
|
||||
aiFallback: data.withWorkflowSettings ? data.aiFallback : true,
|
||||
runSequentially: data.withWorkflowSettings ? data.runSequentially : false,
|
||||
@@ -220,12 +220,9 @@ function StartNode({ id, data }: NodeProps<StartNode>) {
|
||||
<HelpTooltip content="If code has been generated and saved from a previously successful run, set this to 'Code' to use that code when executing the workflow. To avoid using code, set this to 'Skyvern Agent'." />
|
||||
</div>
|
||||
<Select
|
||||
value={!inputs.useScriptCache ? "ai" : "code"}
|
||||
value={inputs.runWith ?? "agent"}
|
||||
onValueChange={(value) => {
|
||||
handleChange(
|
||||
"useScriptCache",
|
||||
value === "code",
|
||||
);
|
||||
handleChange("runWith", value);
|
||||
}}
|
||||
>
|
||||
<SelectTrigger className="w-48">
|
||||
|
||||
@@ -12,7 +12,7 @@ export type WorkflowStartNodeData = {
|
||||
maxScreenshotScrolls: number | null;
|
||||
extraHttpHeaders: string | null;
|
||||
editable: boolean;
|
||||
useScriptCache: boolean;
|
||||
runWith: string | null;
|
||||
scriptCacheKey: string | null;
|
||||
aiFallback: boolean;
|
||||
runSequentially: boolean;
|
||||
|
||||
@@ -149,7 +149,7 @@ function getWorkflowElements(version: WorkflowVersion) {
|
||||
extraHttpHeaders: version.extra_http_headers
|
||||
? JSON.stringify(version.extra_http_headers)
|
||||
: null,
|
||||
useScriptCache: version.generate_script,
|
||||
runWith: version.run_with,
|
||||
scriptCacheKey: version.cache_key,
|
||||
aiFallback: version.ai_fallback ?? true,
|
||||
runSequentially: version.run_sequentially ?? false,
|
||||
|
||||
@@ -703,7 +703,7 @@ function getElements(
|
||||
maxScreenshotScrolls: settings.maxScreenshotScrolls,
|
||||
extraHttpHeaders: settings.extraHttpHeaders,
|
||||
editable,
|
||||
useScriptCache: settings.useScriptCache,
|
||||
runWith: settings.runWith,
|
||||
scriptCacheKey: settings.scriptCacheKey,
|
||||
aiFallback: settings.aiFallback ?? true,
|
||||
label: "__start_block__",
|
||||
@@ -1417,7 +1417,7 @@ function getWorkflowSettings(nodes: Array<AppNode>): WorkflowSettings {
|
||||
model: null,
|
||||
maxScreenshotScrolls: null,
|
||||
extraHttpHeaders: null,
|
||||
useScriptCache: false,
|
||||
runWith: "agent",
|
||||
scriptCacheKey: null,
|
||||
aiFallback: true,
|
||||
runSequentially: false,
|
||||
@@ -1439,7 +1439,7 @@ function getWorkflowSettings(nodes: Array<AppNode>): WorkflowSettings {
|
||||
model: data.model,
|
||||
maxScreenshotScrolls: data.maxScreenshotScrolls,
|
||||
extraHttpHeaders: data.extraHttpHeaders,
|
||||
useScriptCache: data.useScriptCache,
|
||||
runWith: data.runWith,
|
||||
scriptCacheKey: data.scriptCacheKey,
|
||||
aiFallback: data.aiFallback,
|
||||
runSequentially: data.runSequentially,
|
||||
@@ -2133,7 +2133,7 @@ function convert(workflow: WorkflowApiResponse): WorkflowCreateYAMLRequest {
|
||||
blocks: convertBlocksToBlockYAML(workflow.workflow_definition.blocks),
|
||||
},
|
||||
is_saved_task: workflow.is_saved_task,
|
||||
generate_script: workflow.generate_script,
|
||||
run_with: workflow.run_with,
|
||||
cache_key: workflow.cache_key,
|
||||
ai_fallback: workflow.ai_fallback ?? undefined,
|
||||
run_sequentially: workflow.run_sequentially ?? undefined,
|
||||
|
||||
@@ -527,7 +527,7 @@ export type WorkflowApiResponse = {
|
||||
created_at: string;
|
||||
modified_at: string;
|
||||
deleted_at: string | null;
|
||||
generate_script: boolean;
|
||||
run_with: string | null; // 'agent' or 'code'
|
||||
cache_key: string | null;
|
||||
ai_fallback: boolean | null;
|
||||
run_sequentially: boolean | null;
|
||||
@@ -541,7 +541,7 @@ export type WorkflowSettings = {
|
||||
model: WorkflowModel | null;
|
||||
maxScreenshotScrolls: number | null;
|
||||
extraHttpHeaders: string | null;
|
||||
useScriptCache: boolean;
|
||||
runWith: string | null; // 'agent' or 'code'
|
||||
scriptCacheKey: string | null;
|
||||
aiFallback: boolean | null;
|
||||
runSequentially: boolean;
|
||||
|
||||
@@ -14,7 +14,7 @@ export type WorkflowCreateYAMLRequest = {
|
||||
is_saved_task?: boolean;
|
||||
max_screenshot_scrolls?: number | null;
|
||||
extra_http_headers?: Record<string, string> | null;
|
||||
generate_script?: boolean;
|
||||
run_with?: string | null;
|
||||
cache_key?: string | null;
|
||||
ai_fallback?: boolean;
|
||||
run_sequentially?: boolean;
|
||||
|
||||
@@ -114,7 +114,7 @@ const useWorkflowSave = () => {
|
||||
max_screenshot_scrolls: saveData.settings.maxScreenshotScrolls,
|
||||
totp_verification_url: saveData.workflow.totp_verification_url,
|
||||
extra_http_headers: extraHttpHeaders,
|
||||
generate_script: saveData.settings.useScriptCache,
|
||||
run_with: saveData.settings.runWith,
|
||||
cache_key: normalizedKey,
|
||||
ai_fallback: saveData.settings.aiFallback ?? true,
|
||||
workflow_definition: {
|
||||
|
||||
Reference in New Issue
Block a user