---
schema_version: "1"
id: 664f5e3eda1c83d4153d986307efb329e5b6b98a529b212077a64c746d84f2dc
title: Implementing Workflow Steps
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/retail_api/cg_retail_implementing_workflow_steps.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.retail_api.meta/retail_api/cg_retail_implementing_workflow_steps.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: f45c59091b17d376c9b3b2148c32a23d99cd221858fc2d9a7f5d571bf165c9b8
description: Workflow Steps are implemented as APEX classes that are used in implementing the System.Callable interface.
---
# Implementing Workflow Steps

Workflow Steps are implemented as APEX classes that are used in implementing the System.Callable interface.

global with sharing class <your class name> implements System.Callable {
    global Object call(String method, Map<String, Object> context) {
        ...
    }
}

In the Workflow Step record, you need to define 2 attributes that maps to the APEX class:

- Classname: The name of the APEX class that will be instantiated.
- Method: The string value that will be sent to the APEX class call method as first parameter.
- Entity: Defines the entity that will be passed to the APEX class.

On the context parameter, the passed in Object contains the following properties:

// Common to all steps.
String txId: TransactionId of the process
String salesOrg: Sales organization passed to the execution.
Object input: Whole Input Object
Object output: Whole Output Object
 
// Step specific
SObject workflowStepRecord: Workflow Step Record.
 
// Entity specific
String inputPath: Path of the current input in the main input object.
String inputEntityPath: A list of the names of the parent input entities ordered based on the deepness level. (i.e. Promotion/Tactic/TacticBrand).
Object currentInput: Current block of the input object being processed.
List<Object> parentInputs: A list of the parent Input Entities for this step. Each entry on the list will be the input Entity. Has the same number of elements as the inputEntityPath. (i.e. \[ 0 \] → Promotion, \[ 1 \] → Tactic, \[ 2 \] → TacticBrand)
 
String outputPath: Path of the current output in the main output object.
String outputEntityPath: A list of the names of the parent output entities ordered based on the deepness level. (i.e. BOPromotion/LOTactic).
Object currentOutput:  Output object where the rule is expected to set the attributes. Rules are expected to set this object into the proper place of the parent.
List<Object> parentOutputs: A list of the parent Output Entities for this step. Each entry on the list will be the output Object for the Entity. Has the same number of elements as the outputEntityPath. (i.e. \[ 0 \] → BOPromotion, \[ 1 \] → LOTactic)

During runtime, each Workflow Step is executed once for each available entity.