SAP Business Technology Platform (BTP) offers modern process automation capabilities. A lightweight workflow capability orchestrates service calls and user interaction steps. Typical examples for user interaction are single or multi-step approvals or requests for form-based user input. The workflow service is tightly integrated with the SAP Business Technology Platform infrastructure. This is true for concepts such as multi-tenancy and subscriptions, destinations, role assignments, and scaling and for services, for example, SAP Fiori launchpad, the My Inbox app, and the SAP Integration services on BTP. For on-premise systems, customers can integrate all relevant parts of the service, including identity provider integration and system orchestration, using standard SAP Business Technology Platform means, for example, the cloud connector.
Beneath workflow SAP Build Process Automation includes a tool-set to automate decisions, end-to-end process visibility, my inbox, and integration with Artificial Intelligence services.
Digital Process Automation
SAP Business Technology Platform offers an array of automation capabilities.

To use workflows as orchestration or extension flows on SAP Business Technology Platform, a run- and design time exists.
Workflow Editor–Design Your Workflows

Web based BPMN editor within SAP Business Application Studio to design workflows.
Key Features Are:
- Define business key as nontechnical unique identifier of a workflow instance.
- Model gateways & events.
- Model user, service & mail tasks.
- Use script tasks to modify data and implement light-weight business logic.
- Rapid modeling using speed buttons.
- Error highlighting
- Directly deploy workflow to runtime.
Designing Workflows: Custom Workflow Attributes:

Facts about Custom Workflow Attributes:
- Define business-related properties and assign them to workflows such as project ID or project name.
- Use the respective workflow service API to search for custom workflow attributes or to find the respective workflow instances at runtime.
Events

Start and End events mark the start and endpoint of a workflow
Besides Intermediate Message, Intermediate Escalation Event and Intermediate Timer events are available to affect the process flow.

The figure lists the different types of events.
Designing Workflows with Events - Configure Intermediate Escalation Throw Events
An intermediate escalation throw event is used to communicate the occurrence of an event from a workflow instance to its parent workflow instance in the workflow instances hierarchy.

Key Features:
- When workflow execution arrives at an intermediate escalation throw event, an escalation is thrown.
- Escalation can be caught by a boundary escalation event configured with the same escalation code on a referenced sub flow.
- If there is no matching boundary escalation event, then the flow continues as usual.
- Note: JUEL expressions are not supported in escalation codes.
Designing Workflows with Service tasks
Service tasks establish outbound connectivity to external systems and services.

Key Features:
- Support for calling REST/OData based services (GET/POST/PATCH/PUT/DELETE).
- Protection against XSRF (cross-site request forgery) attacks for POST, DELETE, PATCH, PUT via XSRF token path.
- Define request payload.
- Store service response in workflow context.
- Uses destination service for endpoint abstraction.
- Configure Principal Propagation to forward the information who is logged on
- Search and use APIs from SAP API Business Hub.
- Supports SAP Cloud Integration as endpoint for full integration options.
Invoke business rule in SAP Business Technology Platform Business Rules Capability.
Designing Workflows with User tasks
User tasks represent a task that a human performs & can be accessed by end users in My Inbox.

Key Features:
- Define task attributes such as subject and description.
- Define priority (default: medium).
- Define individual users or groups as task recipients.
- Set date by when the task is due.
- Use expressions to refer to the dynamic workflow context.
- Define business-related properties with custom attributes.
- Configure a custom task user interface for task details to be shown in My Inbox (Custom Task UI, generated Basic Task UI, Workflow Forms).
- Optional: configure Boundary Timer Event to trigger alternative flow if the task hasn’t been finished within a specific timeframe.
Designing Workflows with Script task
Script tasks can be used to modify the workflow context at any point within the execution of the workflow.

Key Features:
- Read and write objects from/to the workflow context.
- Transformation of data objects using JavaScript.
- Access to contextual information (such as workflow instance ID).
- Interact with the workflow context, using the predefined identifier'$.context'.
Designing Workflows with Mail Task
Mail tasks can be used to send e-mails to one or more recipients.

Key Features:
- Configure workflow service mail destination in SAP BTP Cockpit.
- Define mail addresses (also cc, bcc) to whom mail should be sent.
- Select to ignore invalid recipients.
- Use expressions to dynamically define recipients, subjects and content.
- Define subject and configure mail body (plain text or HTML).
Designing Workflows with Gateways
Gateways are used to control the flow of the workflow.

Key Features:
- Support exclusive gateway to model decisions.
- Expressions can be used to define the conditions for an exclusive gateway.
- Support parallel gateway to split into multiple paths of execution or merge (join) incoming paths.
Designing Workflows with Sub-Flows
Subflows are used to control the flow of the workflow on different levels and reuse parts as well as parallelize in par-for-each approach.

Key Features:
- Support subflows.
- Expressions can be used to define par for each for dynamic parallel subflows.
- Context Mapping tbd in Subflow definition.
Designing Workflows with Error Handling
Workflow editor provides a mechanism to highlight the errors in the workflow before deployment.

Key Features:
- Elements containing errors are highlighted in the canvas.
- Provides information on the actual errors that need to be resolved.
- Prevents deployment of erroneous workflow.
Task User Interface (UI) Technologies
Workflow Forms
Declarative approach to model simple form and approval UIs.
- Tool: Form Editor.


Workflow Task UI
- SAPUI5 Component
Generated and to be enhanced by developer Task Instance Data & Task Context Model, My Inbox API, ….
- Tools: Code and Layout Editor.
Custom Task UI
SAPUI5 Component: Views, Controller, Model, Bindings, My Inbox API, ….
- Built by developer from scratch.
- Tools: Code and Layout Editor.
Dev Speed of Workflow UIs

The figure illustrates the possible combination between degree of flexibility and development speed for the different UIs.
Workflow Monitoring
SAP Fiori application to manage workflow definitions and instances in the workflow service runtime.

Key Features:
- Start workflow instances.
- Download workflow models (JSON format).
- Retry execution of failed steps.
- Suspend, resume & terminate workflow instances.
- List of running, erroneous, suspended, canceled or completed workflow instances (apply needed filter) or filter based on definitions.
- Search workflow instances.
- Investigate error messages of workflow instance.
- Access the workflow context (required role: WorkflowContextViewer).
- Follow the execution log.
- Show tasks related to a workflow instance.
My Inbox
Manage tasks across different devices from different source systems.

Key Features:
- Provided via standard Fiori Launchpad content.
- Show list of assigned tasks.
- Search for individual tasks.
- Filter, sort or group the tasks.
- Open task details
- Claim tasks
- Take action on tasks.
- Inspect Workflow Log.
Workflow APIs
REST APIs are available in SAP Business Accelerator Hub. Access workflow definitions, instances, task instance and much more (POST, PATCH & PUT are CSRF-protected).

Process Content for SAP Build Process Automation
To speed up your workflow development with SAP Build Process Automation take a look at sample and content packages under https://api.sap.com/content-type/Workflow/workflowmanagement/packages on the SAP Business Accelerator Hub.
