Workflow Interface

Workflow encapsulates the orchestration of activities and child workflows. It can also answer synchronous queries and receive external events (also known as signals).

A workflow must define an interface class. All of its methods must have one of the following annotations:

You can have more than one method with the same annotation. For example:

public interface FileProcessingWorkflow {

    @WorkflowMethod(executionStartToCloseTimeoutSeconds = 10, taskList = "file-processing")
    String processFile(Arguments args);

    @QueryMethod(name="history")
    List<String> getHistory();

    @QueryMethod(name="status")
    String getStatus();

    @SignalMethod
    void retryNow();
}

We recommended that you use a single value type argument for workflow methods. This way, adding new arguments as fields to the value type is a backwards-compatible change.