Skip to content

Conversation

treblereel
Copy link
Contributor

It would be nice to have AgentTaskConfigurer conditional(Predicate<?> predicate, Object agent) in the AgenticDSL


public static AgentTaskConfigurer conditional(Predicate<?> predicate, Object agent) {
return list -> list.agent(agent).when(predicate);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a new overload conditional(predicate, agents..) in case we can call a sequence of agents under a certain condition.

return list -> list.agent(agent).when(predicate);
}

public static AgentTaskConfigurer conditionalSequence(Predicate<?> predicate, Object... agents) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can keep this as "sequence" or "conditional". Too long :)

return list -> list.sequence(agents).when(predicate);
}

public static AgentTaskConfigurer conditionalParallel(Predicate<?> predicate, Object... agents) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same thing. We can name this just parallel.

Signed-off-by: Dmitrii Tikhomirov <[email protected]>
@treblereel treblereel force-pushed the AgenticDSL.conditional branch from 3a51e25 to f06ae2b Compare September 24, 2025 18:33
@ricardozanini ricardozanini merged commit fd74d80 into serverlessworkflow:main Sep 24, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants