Skip to main content

Annotations Reference

FlowForge uses a set of specialized annotations to enable a Code-First experience in Spring Boot applications. This guide describes each annotation and its parameters.


@TaskHandler

Marks a Spring @Component or @Bean as a container for workflow tasks.

ParameterTypeDefaultDescription
valueString""Optional logical group tag. Used for documentation, dashboards, and logical organization in the Task Registry. It does not prefix the task IDs.

Example

@Component
@TaskHandler("ecommerce-logic")
public class OrderTasks { ... }

@FlowTask

Applied to methods within a @TaskHandler class to register them as steps in a workflow.

ParameterTypeDefaultDescription
idStringRequiredThe unique technical identifier for this task in the registry.
retryMaxRetriesint-1Maximum number of retry attempts on failure.
retryBackoffMillislong-1Wait time (ms) between retries (exponential backoff).
timeoutMillislong-1Maximum execution time (ms) allowed for this task.

Example

@FlowTask(
id = "sendEmail",
retryMaxRetries = 3,
timeoutMillis = 5000
)
public Mono<Void> sendEmail(Order order) { ... }

@FlowWorkflow

Registers a class (implementing WorkflowDefinition) as a discoverable workflow blueprint.

ParameterTypeDefaultDescription
idStringRequiredThe unique identifier used to trigger this workflow via FlowForgeClient.

Example

@Component
@FlowWorkflow(id = "order-process")
public class OrderProcessWorkflow implements WorkflowDefinition { ... }