Complete an Instance Step

Complete an instance step that is currently Active. If the step is configured with output fields, you can set the values of those output fields while completing the step.

šŸ‘

Permissions Required

You must have admin access to the Instance for this request to succeed

Method Signature

InstanceStep completeStep(String id, List<Field> fields);

Parameters

ParameterTypeDescription
workflowIdStringThe ID of the Instance Step to complete
fieldsList<Field>named fields to set on the InstanceStep.
Must match Fields configured on the InstanceStep.
returnsInstanceStepThe completed Instance Step

Example

/*
 * Demonstrates starting a Workflow Instance, then completing
 * a Step in that Instance. Both text and file fields are
 * set during task completion.
 */
import org.catalytic.sdk.CatalyticClient;
import org.catalytic.sdk.entities.InstanceStep;
import java.util.List;
import java.util.ArrayList;

public class Program {
  
    public static void main(String[] args) throws Exception {
      
      	// Create and initizlie CatalyticClient
        CatalyticClient catalytic = new CatalyticClient();
      	
      	// Create the fields to complete the InstanceStep with
        List<Field> fields = new ArrayList<>();
      	Field field = new Field("name", "Alice");
      	fields.add(field);
      
      	// Complete the InstanceStep
        InstanceStep step = catalytic.instances().completeStep("dc0ca16c-789c-402f-9a8e-b29a79a9bcc1", fields);
    }
}