Start a workflow

Tell the SDK to start running a workflow

Starting a workflow is simple. Simply call selectStartWorkflow(workflow: Workflow) and pass the Workflow struct representing the workflow that you want to start to the function.

// a view displaying information about the workflow which is implemented in
// a listView of each workflow
// We will use this as a button to start the workflow
// The parent view is wrapped with the CloneableWorkflowWrapper
struct WorkflowCellView: View {
    @State var workflow: Workflow
    var cloneable: CloneablePlatform
    
    var body: some View {
        VStack {
            Text(workflow.workflowName)
            Text(workflow.workflowDescription)
        }  
        .contentShape(Rectangle())
        .onTapGesture {
            if workflow.readyToRun {
                // Start the workflow
                cloneable.selectStartWorkflow(workflow: workflow)
            }
        } 
    }
}

The SDK will take over rendering and immediately start the workflow

When the workflow is complete or cancelled, the CloneableWorkflowWrapper will re-present the Views that you passed to it's completion. Effectively passing render control back to your app

Last updated