denpendent run frontend (#3462)
This commit is contained in:
@@ -64,6 +64,7 @@ function Debugger() {
|
|||||||
useScriptCache: workflow.generate_script,
|
useScriptCache: workflow.generate_script,
|
||||||
scriptCacheKey: workflow.cache_key,
|
scriptCacheKey: workflow.cache_key,
|
||||||
aiFallback: workflow.ai_fallback ?? true,
|
aiFallback: workflow.ai_fallback ?? true,
|
||||||
|
runSequentially: workflow.run_sequentially ?? false,
|
||||||
};
|
};
|
||||||
|
|
||||||
const elements = getElements(
|
const elements = getElements(
|
||||||
|
|||||||
@@ -65,6 +65,7 @@ function WorkflowEditor() {
|
|||||||
useScriptCache: workflow.generate_script,
|
useScriptCache: workflow.generate_script,
|
||||||
scriptCacheKey: workflow.cache_key,
|
scriptCacheKey: workflow.cache_key,
|
||||||
aiFallback: workflow.ai_fallback ?? true,
|
aiFallback: workflow.ai_fallback ?? true,
|
||||||
|
runSequentially: workflow.run_sequentially ?? false,
|
||||||
};
|
};
|
||||||
|
|
||||||
const elements = getElements(
|
const elements = getElements(
|
||||||
|
|||||||
@@ -75,6 +75,7 @@ function StartNode({ id, data }: NodeProps<StartNode>) {
|
|||||||
useScriptCache: data.withWorkflowSettings ? data.useScriptCache : false,
|
useScriptCache: data.withWorkflowSettings ? data.useScriptCache : false,
|
||||||
scriptCacheKey: data.withWorkflowSettings ? data.scriptCacheKey : null,
|
scriptCacheKey: data.withWorkflowSettings ? data.scriptCacheKey : null,
|
||||||
aiFallback: data.withWorkflowSettings ? data.aiFallback : true,
|
aiFallback: data.withWorkflowSettings ? data.aiFallback : true,
|
||||||
|
runSequentially: data.withWorkflowSettings ? data.runSequentially : false,
|
||||||
});
|
});
|
||||||
|
|
||||||
const [facing, setFacing] = useState<"front" | "back">("front");
|
const [facing, setFacing] = useState<"front" | "back">("front");
|
||||||
@@ -254,6 +255,19 @@ function StartNode({ id, data }: NodeProps<StartNode>) {
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
<div className="space-y-2">
|
||||||
|
<div className="flex items-center gap-2">
|
||||||
|
<Label>Run Sequentially</Label>
|
||||||
|
<HelpTooltip content="Run the workflow in a sequential order" />
|
||||||
|
<Switch
|
||||||
|
className="ml-auto"
|
||||||
|
checked={inputs.runSequentially}
|
||||||
|
onCheckedChange={(value) => {
|
||||||
|
handleChange("runSequentially", value);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div className="space-y-2">
|
<div className="space-y-2">
|
||||||
<div className="flex items-center gap-2">
|
<div className="flex items-center gap-2">
|
||||||
<Label>Save & Reuse Session</Label>
|
<Label>Save & Reuse Session</Label>
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ export type WorkflowStartNodeData = {
|
|||||||
useScriptCache: boolean;
|
useScriptCache: boolean;
|
||||||
scriptCacheKey: string | null;
|
scriptCacheKey: string | null;
|
||||||
aiFallback: boolean;
|
aiFallback: boolean;
|
||||||
|
runSequentially: boolean;
|
||||||
label: "__start_block__";
|
label: "__start_block__";
|
||||||
showCode: boolean;
|
showCode: boolean;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -708,6 +708,7 @@ function getElements(
|
|||||||
aiFallback: settings.aiFallback ?? true,
|
aiFallback: settings.aiFallback ?? true,
|
||||||
label: "__start_block__",
|
label: "__start_block__",
|
||||||
showCode: false,
|
showCode: false,
|
||||||
|
runSequentially: settings.runSequentially,
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -1418,6 +1419,7 @@ function getWorkflowSettings(nodes: Array<AppNode>): WorkflowSettings {
|
|||||||
useScriptCache: false,
|
useScriptCache: false,
|
||||||
scriptCacheKey: null,
|
scriptCacheKey: null,
|
||||||
aiFallback: true,
|
aiFallback: true,
|
||||||
|
runSequentially: false,
|
||||||
};
|
};
|
||||||
const startNodes = nodes.filter(isStartNode);
|
const startNodes = nodes.filter(isStartNode);
|
||||||
const startNodeWithWorkflowSettings = startNodes.find(
|
const startNodeWithWorkflowSettings = startNodes.find(
|
||||||
@@ -1438,6 +1440,7 @@ function getWorkflowSettings(nodes: Array<AppNode>): WorkflowSettings {
|
|||||||
useScriptCache: data.useScriptCache,
|
useScriptCache: data.useScriptCache,
|
||||||
scriptCacheKey: data.scriptCacheKey,
|
scriptCacheKey: data.scriptCacheKey,
|
||||||
aiFallback: data.aiFallback,
|
aiFallback: data.aiFallback,
|
||||||
|
runSequentially: data.runSequentially,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
return defaultSettings;
|
return defaultSettings;
|
||||||
|
|||||||
@@ -530,6 +530,7 @@ export type WorkflowApiResponse = {
|
|||||||
generate_script: boolean;
|
generate_script: boolean;
|
||||||
cache_key: string | null;
|
cache_key: string | null;
|
||||||
ai_fallback: boolean | null;
|
ai_fallback: boolean | null;
|
||||||
|
run_sequentially: boolean | null;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type WorkflowSettings = {
|
export type WorkflowSettings = {
|
||||||
@@ -542,6 +543,7 @@ export type WorkflowSettings = {
|
|||||||
useScriptCache: boolean;
|
useScriptCache: boolean;
|
||||||
scriptCacheKey: string | null;
|
scriptCacheKey: string | null;
|
||||||
aiFallback: boolean | null;
|
aiFallback: boolean | null;
|
||||||
|
runSequentially: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type WorkflowModel = JsonObjectExtendable<{ model_name: string }>;
|
export type WorkflowModel = JsonObjectExtendable<{ model_name: string }>;
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ export type WorkflowCreateYAMLRequest = {
|
|||||||
generate_script?: boolean;
|
generate_script?: boolean;
|
||||||
cache_key?: string | null;
|
cache_key?: string | null;
|
||||||
ai_fallback?: boolean;
|
ai_fallback?: boolean;
|
||||||
|
run_sequentially?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type WorkflowDefinitionYAML = {
|
export type WorkflowDefinitionYAML = {
|
||||||
|
|||||||
@@ -122,6 +122,7 @@ const useWorkflowSave = () => {
|
|||||||
blocks: saveData.blocks,
|
blocks: saveData.blocks,
|
||||||
},
|
},
|
||||||
is_saved_task: saveData.workflow.is_saved_task,
|
is_saved_task: saveData.workflow.is_saved_task,
|
||||||
|
run_sequentially: saveData.settings.runSequentially,
|
||||||
};
|
};
|
||||||
|
|
||||||
const yaml = convertToYAML(requestBody);
|
const yaml = convertToYAML(requestBody);
|
||||||
|
|||||||
Reference in New Issue
Block a user