denpendent run frontend (#3462)

This commit is contained in:
LawyZheng
2025-09-18 17:40:59 +08:00
committed by GitHub
parent 3e12133af9
commit 31a9fe19bc
8 changed files with 24 additions and 0 deletions

View File

@@ -64,6 +64,7 @@ function Debugger() {
useScriptCache: workflow.generate_script,
scriptCacheKey: workflow.cache_key,
aiFallback: workflow.ai_fallback ?? true,
runSequentially: workflow.run_sequentially ?? false,
};
const elements = getElements(

View File

@@ -65,6 +65,7 @@ function WorkflowEditor() {
useScriptCache: workflow.generate_script,
scriptCacheKey: workflow.cache_key,
aiFallback: workflow.ai_fallback ?? true,
runSequentially: workflow.run_sequentially ?? false,
};
const elements = getElements(

View File

@@ -75,6 +75,7 @@ function StartNode({ id, data }: NodeProps<StartNode>) {
useScriptCache: data.withWorkflowSettings ? data.useScriptCache : false,
scriptCacheKey: data.withWorkflowSettings ? data.scriptCacheKey : null,
aiFallback: data.withWorkflowSettings ? data.aiFallback : true,
runSequentially: data.withWorkflowSettings ? data.runSequentially : false,
});
const [facing, setFacing] = useState<"front" | "back">("front");
@@ -254,6 +255,19 @@ function StartNode({ id, data }: NodeProps<StartNode>) {
</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="flex items-center gap-2">
<Label>Save &amp; Reuse Session</Label>

View File

@@ -15,6 +15,7 @@ export type WorkflowStartNodeData = {
useScriptCache: boolean;
scriptCacheKey: string | null;
aiFallback: boolean;
runSequentially: boolean;
label: "__start_block__";
showCode: boolean;
};

View File

@@ -708,6 +708,7 @@ function getElements(
aiFallback: settings.aiFallback ?? true,
label: "__start_block__",
showCode: false,
runSequentially: settings.runSequentially,
}),
);
@@ -1418,6 +1419,7 @@ function getWorkflowSettings(nodes: Array<AppNode>): WorkflowSettings {
useScriptCache: false,
scriptCacheKey: null,
aiFallback: true,
runSequentially: false,
};
const startNodes = nodes.filter(isStartNode);
const startNodeWithWorkflowSettings = startNodes.find(
@@ -1438,6 +1440,7 @@ function getWorkflowSettings(nodes: Array<AppNode>): WorkflowSettings {
useScriptCache: data.useScriptCache,
scriptCacheKey: data.scriptCacheKey,
aiFallback: data.aiFallback,
runSequentially: data.runSequentially,
};
}
return defaultSettings;

View File

@@ -530,6 +530,7 @@ export type WorkflowApiResponse = {
generate_script: boolean;
cache_key: string | null;
ai_fallback: boolean | null;
run_sequentially: boolean | null;
};
export type WorkflowSettings = {
@@ -542,6 +543,7 @@ export type WorkflowSettings = {
useScriptCache: boolean;
scriptCacheKey: string | null;
aiFallback: boolean | null;
runSequentially: boolean;
};
export type WorkflowModel = JsonObjectExtendable<{ model_name: string }>;

View File

@@ -17,6 +17,7 @@ export type WorkflowCreateYAMLRequest = {
generate_script?: boolean;
cache_key?: string | null;
ai_fallback?: boolean;
run_sequentially?: boolean;
};
export type WorkflowDefinitionYAML = {

View File

@@ -122,6 +122,7 @@ const useWorkflowSave = () => {
blocks: saveData.blocks,
},
is_saved_task: saveData.workflow.is_saved_task,
run_sequentially: saveData.settings.runSequentially,
};
const yaml = convertToYAML(requestBody);