feat: migrate workflow use_cache field to generate_script (#3154)
Co-authored-by: devsy-bot <no-reply@devsy.ai> Co-authored-by: Shuchang Zheng <wintonzheng0325@gmail.com>
This commit is contained in:
@@ -170,7 +170,7 @@ function WorkflowDebugger() {
|
||||
extraHttpHeaders: workflow.extra_http_headers
|
||||
? JSON.stringify(workflow.extra_http_headers)
|
||||
: null,
|
||||
useScriptCache: workflow.use_cache,
|
||||
useScriptCache: workflow.generate_script,
|
||||
scriptCacheKey: workflow.cache_key,
|
||||
};
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ function WorkflowEditor() {
|
||||
extraHttpHeaders: workflow.extra_http_headers
|
||||
? JSON.stringify(workflow.extra_http_headers)
|
||||
: null,
|
||||
useScriptCache: workflow.use_cache,
|
||||
useScriptCache: workflow.generate_script,
|
||||
scriptCacheKey: workflow.cache_key,
|
||||
};
|
||||
|
||||
|
||||
@@ -137,7 +137,7 @@ function StartNode({ id, data }: NodeProps<StartNode>) {
|
||||
<OrgWalled className="flex flex-col gap-4">
|
||||
<div className="space-y-2">
|
||||
<div className="flex items-center gap-2">
|
||||
<Label>Use Script Cache</Label>
|
||||
<Label>Generate Script</Label>
|
||||
<HelpTooltip content="Generate & use cached scripts for faster execution." />
|
||||
<Switch
|
||||
className="ml-auto"
|
||||
@@ -150,8 +150,8 @@ function StartNode({ id, data }: NodeProps<StartNode>) {
|
||||
</div>
|
||||
<div className="space-y-2">
|
||||
<div className="flex gap-2">
|
||||
<Label>Script Cache Key</Label>
|
||||
<HelpTooltip content="A templated name, comprised of one or more of your parameters, that defines the key for your script cache." />
|
||||
<Label>Script Key</Label>
|
||||
<HelpTooltip content="A constant string or templated name, comprised of one or more of your parameters. It's the uinique key for a workflow script." />
|
||||
</div>
|
||||
<Input
|
||||
value={inputs.scriptCacheKey ?? ""}
|
||||
|
||||
@@ -504,7 +504,7 @@ export type WorkflowApiResponse = {
|
||||
created_at: string;
|
||||
modified_at: string;
|
||||
deleted_at: string | null;
|
||||
use_cache: boolean;
|
||||
generate_script: boolean;
|
||||
cache_key: string | null;
|
||||
};
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ export type WorkflowCreateYAMLRequest = {
|
||||
is_saved_task?: boolean;
|
||||
max_screenshot_scrolls?: number | null;
|
||||
extra_http_headers?: Record<string, string> | null;
|
||||
use_cache?: boolean;
|
||||
generate_script?: boolean;
|
||||
cache_key?: string | null;
|
||||
};
|
||||
|
||||
|
||||
@@ -110,7 +110,7 @@ const useWorkflowSave = () => {
|
||||
max_screenshot_scrolls: saveData.settings.maxScreenshotScrolls,
|
||||
totp_verification_url: saveData.workflow.totp_verification_url,
|
||||
extra_http_headers: extraHttpHeaders,
|
||||
use_cache: saveData.settings.useScriptCache,
|
||||
generate_script: saveData.settings.useScriptCache,
|
||||
cache_key: saveData.settings.scriptCacheKey,
|
||||
workflow_definition: {
|
||||
parameters: saveData.parameters,
|
||||
|
||||
Reference in New Issue
Block a user