Workflow
public class Workflow : @unchecked Sendable
Class representing a workflow.
-
The configuration for the workflow.
Declaration
Swift
public let config: WorkflowConfig -
Global SharedContext
Declaration
Swift
public let sharedContext: SharedContext -
Initializes the workflow.
Declaration
Swift
public init(config: WorkflowConfig)Parameters
configThe configuration for the workflow.
-
initialize()AsynchronousInitializes the workflow.
Declaration
Swift
public func initialize() async throws -
start()Asynchronous -
next(_:Asynchronous_: ) Processes the next node in the workflow.
Declaration
Swift
public func next(_ context: FlowContext, _ current: ContinueNode) async -> NodeParameters
contextThe context of the flow.
currentThe current ContinueNode.
Return Value
The resulting Node after processing the next step.
-
signOff()AsynchronousSigns off the workflow.
Declaration
Swift
public func signOff() async -> Result<Void, Error>Return Value
A Result indicating the success or failure of the sign off.
-
hasCookies()AsynchronousChecks if the workflow has cookies available in storage.
Declaration
Swift
public func hasCookies() async -> BoolReturn Value
A Boolean value indicating whether cookies exist in the storage.
-
Creates a new Workflow instance with the provided configuration block.
Declaration
Swift
public static func createWorkflow(_ block: (WorkflowConfig) -> Void = { _ in }) -> WorkflowParameters
blockThe configuration block for the Workflow.
Return Value
A new Workflow instance.
View on GitHub