Skip to content

Commit 99d2ade

Browse files
committed
[refactor] Update GraphAsTask properties and task registration
- Renamed GraphAsTask title and description to better reflect its purpose as a group of tasks executed together. - Changed the category of GraphAsTask from "Hidden" to "Flow Control" for improved clarity. - Adjusted the task registration order in index.ts to prioritize GraphAsTask. - Removed the unused ArrayTask import from common.ts to streamline the codebase.
1 parent 208f96d commit 99d2ade

4 files changed

Lines changed: 5 additions & 7 deletions

File tree

packages/task-graph/src/task/GraphAsTask.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ export class GraphAsTask<
3838
// ========================================================================
3939

4040
public static type: TaskTypeName = "GraphAsTask";
41-
public static title: string = "Graph as Task";
42-
public static description: string = "A task that contains a subgraph of tasks";
43-
public static category: string = "Hidden";
41+
public static title: string = "Group";
42+
public static description: string = "A group of tasks that are executed together";
43+
public static category: string = "Flow Control";
4444
public static compoundMerge: CompoundMergeStrategy = PROPERTY_ARRAY;
4545

4646
/** This task has dynamic schemas that change based on the subgraph structure */

packages/task-graph/src/task/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import { TaskRegistry } from "./TaskRegistry";
3232
import { WhileTask } from "./WhileTask";
3333

3434
export const registerBaseTasks = () => {
35-
const tasks = [ConditionalTask, GraphAsTask, MapTask, WhileTask, ReduceTask];
35+
const tasks = [GraphAsTask, ConditionalTask, MapTask, WhileTask, ReduceTask];
3636
tasks.map(TaskRegistry.registerTask);
3737
return tasks;
3838
};

packages/tasks/src/common.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ export * from "./task/OutputTask";
1717
export * from "./task/SplitTask";
1818

1919
import { TaskRegistry } from "@workglow/task-graph";
20-
import { ArrayTask } from "./task/ArrayTask";
2120
import { DebugLogTask } from "./task/DebugLogTask";
2221
import { DelayTask } from "./task/DelayTask";
2322
import { FetchUrlTask } from "./task/FetchUrlTask";
@@ -34,7 +33,6 @@ import { SplitTask } from "./task/SplitTask";
3433
// and prevents tree-shaking issues.
3534
export const registerCommonTasks = () => {
3635
const tasks = [
37-
ArrayTask,
3836
DebugLogTask,
3937
DelayTask,
4038
FetchUrlTask,

packages/tasks/src/task/ArrayTask.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ export type DeReplicateFromSchema<S extends { properties: Record<string, any> }>
7373
* 2. Creates a subGraph with one task instance per array element if any input is an array
7474
* 3. Creates all combinations if multiple inputs are arrays
7575
*/
76-
export class ArrayTask<
76+
export abstract class ArrayTask<
7777
Input extends TaskInput = TaskInput,
7878
Output extends TaskOutput = TaskOutput,
7979
Config extends TaskConfig = TaskConfig,

0 commit comments

Comments
 (0)