# SAP Build Process Automation for architects: where a process lives, and how it is governed

> Decide which approvals belong in S/4HANA flexible workflow, SAP Build Process Automation, an agent or no tool, and check a tenant's governance.

- Course: Orchestrate, Unit 21 · SAP BTP as a platform
- Page: https://erpfde.com/topics/sap-build-process-automation/
- Updated: 2026-11-27
- Reading time: Foundational 8 min, Deep 36 min

Independent learning resource. Not affiliated with, sponsored by or endorsed by SAP SE. SAP and other SAP products mentioned are trademarks of SAP SE in Germany and other countries.

## Foundational layer

### The 60-second version

SAP Build Process Automation is SAP's low-code tool on SAP BTP for workflows, decisions, forms and software bots. Anyone with a licence can draw a process in an afternoon. That is the architect's problem: when every approval can become a new process, the landscape fills with processes nobody owns.

S/4HANA already has its own workflow. **Flexible workflow** lets a configuration expert set up approvals on S/4HANA documents, such as purchase orders, without building anything. So the first architecture decision is not *how* to build a process. It is *where* each process should live:

- inside S/4HANA, when the approval belongs to one S/4HANA document;
- in SAP Build Process Automation, when it crosses systems, reads documents or includes people outside the company;
- in an agent, only when the steps change from case to case;
- in an integration flow, when nobody decides anything;
- nowhere yet, when the business hasn't agreed the rule.

The second decision is governance: who may create projects, who may put them into production, who watches them run, and what happens when a bot's machine goes offline.

### Why it matters to the business

> **Example:** Calder Pumpworks, the course's fictional pump maker, had a partner propose SAP Build Process Automation for eight approvals and automations. Placing each one by rule moved six of them. A simple PO approval went back to S/4HANA configuration. A cost center feed became an integration with no workflow. Augsburg's requisition release stayed in its old ECC system, which retires in July 2027. One request had no agreed rule, so it went back to its owners.

The value of getting this right is mostly cost avoided:

- **Fewer things to run.** Every process deployed on BTP needs an owner, monitoring, role assignments and retesting when SAP changes something. A flexible workflow is configuration in S/4HANA, upgraded with it.
- **Controls auditors can read.** An approval is a control. If half of Calder's PO approvals run in S/4HANA and half in BTP, auditors ask which one applies to which order.
- **No bots where an API exists.** A software bot that clicks through S/4HANA screens breaks when a screen changes. SAP's own advice is to choose the option that is "easier for the customer to maintain long-term" ([SAP Learning](https://learning.sap.com/courses/implementing-sap-s-4hana-cloud-public-edition/exploring-flexible-business-workflows_af2a653f-243c-487e-9def-843aa9c76ccc)).

The risk on the other side is real too. Forcing a cross-system process into S/4HANA configuration leads to custom code in the core, which the clean core rules in the [integration platform topic](https://erpfde.com/topics/integration-platform-and-clean-core/) try to avoid.

### How SAP does it

As of November 2026, SAP's materials describe these pieces. Status and scope change, so recheck before you plan.

| Piece | What SAP describes |
| --- | --- |
| SAP Build Process Automation | Workflows (agentic, rule-based and hybrid), attended and unattended bots, document processing, an add-on by UiPath, Actions, Model Context Protocol, API-based process triggers delivered via event mesh, a Task center and process visibility dashboards ([features page](https://www.sap.com/mena/products/technology-platform/process-automation/features.html)) |
| Where it came from | SAP calls it "the evolution of" SAP Workflow Management and SAP Intelligent RPA ([SAP Learning](https://learning.sap.com/courses/implementing-sap-s-4hana-cloud-public-edition/exploring-flexible-business-workflows_af2a653f-243c-487e-9def-843aa9c76ccc)) |
| Flexible workflow in S/4HANA | SAP ships workflow scenario templates that configuration experts set up; approvers see work items in My Inbox (same page) |
| The bridge between them | Extension steps let SAP Business Workflow in ECC and S/4HANA call a process on BTP; the in-app extension step in Manage Workflows exists only for flexible workflow in S/4HANA ([SAP Learning](https://learning.sap.com/courses/sap-workflow-overview-basics-strategy-and-extensibility/explaining-integration-between-sap-build-process-automation-and-s-4hana-sap-ecc_ae7610b1-0c49-4670-85a9-45e748bd4ee1)) |
| Governance | A Control Tower with rules that make project creation and transport need approval, and environments that separate deployed projects ([SAP Learning](https://learning.sap.com/courses/sap-build-developer/exploring-sap-build-governance_a7c2f3c7-1fe1-4003-864c-135ec1c47b7b)) |
| Monitoring | SAP Cloud ALM health monitoring reports bot jobs and connected or disconnected agents ([SAP Cloud ALM](https://support.sap.com/en/alm/sap-cloud-alm/operations/expert-portal/health-monitoring/health-monitoring-setup-configuration/setup-spa.html)) |

Licensing is per user type and add-on. The [Unit 14 topic on its AI features](https://erpfde.com/topics/sap-build-process-automation-with-ai/) recorded SAP's pricing page on 23 November 2026: builder and participant user plans, and unattended automation priced per connection. Plans and prices change, so reopen that page before you budget.

> **Note** **For functional consultants.** Two things change. First, an approval request now gets a placement decision before anyone configures or builds it, and you supply the facts: which S/4HANA document it hangs on, whether a standard workflow scenario covers it, who outside the company takes part. Second, test cases for an approval that uses an extension step cover both sides: the flexible workflow in S/4HANA and the process on BTP it calls.

### Where should this process live?

| If the process... | It lives in | Calder example |
| --- | --- | --- |
| has no agreed rule | Nowhere yet: agree the policy | Sales director releasing credit blocks by phone |
| has no human decision | An integration flow or job | Cost centers to SuccessFactors |
| runs only in a system that retires within a year | That system's workflow, unchanged | Augsburg's requisition release in ECC |
| changes its steps with each case | An agent, which calls a fixed process for the approval | Blocked supplier invoice triage |
| needs a system with no API | A process with a bot, and a date to retire the bot | Carrier invoices from carrier portals |
| approves one S/4HANA document on its own fields | S/4HANA flexible workflow | PO approval above 25,000 USD |
| approves an S/4HANA document but one step needs more | Flexible workflow with an extension step | PO approval with a supplier quote check |
| crosses systems or includes outsiders | SAP Build Process Automation | New supplier onboarding |

### Questions to ask

1. For each process we plan to build: which S/4HANA document does it approve, and does a standard workflow scenario already cover it?
2. Who may create projects in our tenant, and who approves moving one to production?
3. Which environment holds production processes, and who has the right to deploy there?
4. Who is the business owner of each deployed process, and who watches its failed instances?
5. Which bots drive screens of a system that has an API? What is the date each bot retires?
6. How many desktop agents run our unattended bots, and who is alerted when one disconnects?
7. Which inbox do approvers work in, and do they see tasks from both S/4HANA and BTP there?

### Common misconceptions

- **"SAP Build Process Automation replaces S/4HANA workflow."** It sits beside it. SAP connects the two with extension steps, so an approval can stay in S/4HANA and call a process for one step.
- **"Low-code means no governance."** The tool has governance rules for project creation and transport, and environments with sharing privileges. They are off until an administrator sets them.
- **"A bot is a quick integration."** A bot drives a screen. Use it only where a system offers no API, and plan its retirement.
- **"An agent is a smarter workflow."** For a fixed approval an agent adds risk. Let the agent plan the varying steps and call a fixed process for the approval.
- **"Deployed means monitored."** Someone needs the right to monitor the environment, and an alert when an agent machine goes offline.

### Key terms

- **SAP Build Process Automation:** SAP's low-code tool on SAP BTP for workflows, decisions, forms and bots.
- **Flexible workflow:** S/4HANA's configurable approval workflow for its own documents, set up from SAP's scenario templates.
- **Extension step:** a step in an S/4HANA or ECC workflow that calls a process in SAP Build Process Automation.
- **Environment:** a place inside the tenant where projects are deployed and run, with its own sharing rights and agents.
- **Control Tower:** the administration area where governance rules, environments and agents are managed.
- **Desktop agent:** the software on a machine that runs a bot's automation job.
- **Unattended automation:** a bot that runs without a person present, started by a schedule or trigger.

### Check yourself

1. A partner proposes SAP Build Process Automation for a new approval. What should the architect settle first?
   - A. Which designer in the tool builds the process fastest
   - B. Where the approval should live, if anywhere
   - C. How many builder licences the project team needs
   - D. Which bot recorder captures the approval screens best

   Answer: B. The first decision is where the process lives. A tool that makes building easy makes it tempting to build everything, so the placement comes before any design or licence question.

2. Calder's PO approval above 25,000 USD depends only on the purchase order's own fields. Where does it belong?
   - A. A Joule Studio agent that reads the order and decides
   - B. A SAP Build Process Automation process with a custom form
   - C. S/4HANA flexible workflow, configured from SAP's scenario
   - D. An unattended bot that clicks the release button

   Answer: C. One S/4HANA document with rules on its own fields is what flexible workflow is for. It is configuration in S/4HANA, upgraded with the system, with nothing extra on BTP to run.

3. Calder's cost center feed to SuccessFactors involves no human decision. What is the right home?
   - A. A SAP Build Process Automation workflow with an approval step
   - B. An integration flow or a scheduled job
   - C. S/4HANA flexible workflow on the cost center master record
   - D. An attended bot started by a controller each morning

   Answer: B. A workflow exists to route decisions to people. When nobody decides anything, moving the data is an integration job, and a workflow would only add parts to run.

4. Why does Calder keep Augsburg's requisition release in ECC instead of rebuilding it on BTP?
   - A. SAP Build Process Automation can't connect to any ECC system
   - B. ECC workflows run faster than processes on SAP BTP
   - C. ECC retires in July 2027, months after a rebuild
   - D. The auditors require every approval to stay in ECC

   Answer: C. A new build for a system that retires soon is spent money with a short life. SAP does support extension steps from ECC workflows, so the reason is the retirement date, not a technical barrier.

5. Which governance setting stops anyone from moving a project to production without approval?
   - A. Giving every builder the Monitor privilege on production
   - B. Setting the "Transport a Project" rule to Governed
   - C. Deploying all production projects to the Public environment
   - D. Turning on intelligent recommendations for approval tasks

   Answer: B. The Control Tower's "Transport a Project" rule, when Governed, requires approval before a project's content is transported. The Public environment does the opposite of protecting production, since every tenant user with access can reach it.

6. A bot clicks through S/4HANA screens to post data that a released API could accept. What is the risk?
   - A. It breaks when a screen changes; the API is safer
   - B. Bots can't run without a person present at the desktop
   - C. S/4HANA refuses every change that a bot makes on its screens
   - D. Bots cost more licences than any S/4HANA approval workflow

   Answer: A. A bot depends on the screen staying the same. Where an API exists it is the route that survives upgrades; bots belong to systems that offer only screens, with a plan to retire them.

7. What should a leader ask about unattended bots before go-live?
   - A. Whether the bots can approve their own work items
   - B. Whether each bot has its own S/4HANA flexible workflow
   - C. Who is alerted when an agent disconnects
   - D. Whether the bots can be deployed to the Public environment

   Answer: C. An unattended bot runs on an agent machine. If that machine goes offline, the bot stops; SAP Cloud ALM can report disconnected agents, but only if someone turns the alert on and owns it.

## Deep layer

### Mental model

Treat every approval request as a placement question with a short decision list, and every SAP Build Process Automation tenant as a small production platform with its own release process.

The placement list runs from cheapest to run to most expensive: no tool, integration, the old system's workflow, S/4HANA flexible workflow, flexible workflow with an extension step, a process on BTP, a process with a bot, an agent calling a process. You stop at the first home that does the job. The tenant then needs what any platform needs: rules for who creates and promotes, separate places for production, named owners, monitoring and a check that bots only go where APIs don't.

### How it works

#### The parts of SAP Build Process Automation

SAP's features page groups the product as follows, as read on 27 November 2026 ([features](https://www.sap.com/mena/products/technology-platform/process-automation/features.html)):

| Part | What it is for an architect |
| --- | --- |
| Processes and workflows | Steps, approvals, forms and decisions; SAP lists agentic, deterministic (rule-based) and hybrid workflows |
| Decisions | Rule tables a process calls; the [Unit 14 topic](https://erpfde.com/topics/sap-build-process-automation-with-ai/) builds and tests one |
| Automations | Bots built in an automation editor or recorder, run attended (a person starts or reviews them) or unattended (on a schedule or trigger); an add-on by UiPath is listed |
| Actions and triggers | Actions call APIs from a process; API-based process triggers are delivered via event mesh; Model Context Protocol and UI-based integration are listed |
| Business user side | Task center, guided experiences deployed to SAP Build Work Zone, intelligent recommendations for approval tasks, process visibility dashboards |

A project moves through a simple lifecycle. **Release** freezes a snapshot with a version number, 1.0.0 the first time. **Deploy** makes a released version available to run. Released and deployed versions can't be edited: you edit, release again and deploy again. Running instances appear under **Monitor > Process and Workflow Instances** ([SAP Developers tutorial](https://developers.sap.com/tutorials/spa-run-process)).

```mermaid
flowchart LR
  E[Edit project] --> R[Release<br/>version 1.0.0]
  R --> D[Deploy to an<br/>environment]
  D --> M[Monitor<br/>instances and jobs]
  M -->|change needed| E
```

#### Environments and the Control Tower

An **environment** is a place inside the tenant where projects are deployed. Triggers, workflow definitions and API keys live in deployed projects, and agents are assigned to environments ([SAP Community, January 2024](https://community.sap.com/t5/application-development-and-automation-blog-posts/sap-build-process-automation-introducing-environments/ba-p/13574458)). There are two kinds ([SAP Learning](https://learning.sap.com/courses/sap-build-developer/exploring-sap-build-governance_a7c2f3c7-1fe1-4003-864c-135ec1c47b7b)):

- **The Public environment** holds all existing projects and is open to every tenant user with access.
- **Shared environments** are created by users with the ProcessAutomationAdmin role and shared with users or groups. Each share grants privileges: Monitor, View Logs, Deploy, Execute, Administrate and Supervise.

The 2024 community post adds deployment behavior. The deploy button reads Deploy, Upgrade, Redeploy or Downgrade depending on the version. In a shared environment, deploying a version undeploys the previous one. At that time, processes, forms, decisions and workflow definitions were "not yet available" in shared environments. SAP's current help page lists deployed processes and workflow definitions among each environment's views, and points to SAP Note 3394899 on the availability of environments ([SAP Help Portal](https://help.sap.com/docs/PROCESS_AUTOMATION/a331c4ef0a9d48a89c779fd449c022e7/dfa4190bcf7943c0adbe20dff1496f42.html)). Check that note for the artifact types your production design relies on.

The **Control Tower** holds the **governance rules**. Under Tenant Configuration > Governance Rules there are two: "Create a Project" and "Transport a Project". Each is Governed (needs approval) or Ungoverned. Pending approvals appear under Governance Requests. Governance projects run in a Governance environment and need a destination for OAuth2 user token exchange allow-listed there ([SAP Learning](https://learning.sap.com/courses/sap-build-developer/exploring-sap-build-governance_a7c2f3c7-1fe1-4003-864c-135ec1c47b7b)).

#### Bots and agents

A **desktop agent** is the software that runs automation jobs on a machine, on behalf of a user for attended bots. Agents are assigned per environment in its Agent Management view ([SAP Help Portal](https://help.sap.com/docs/PROCESS_AUTOMATION/a331c4ef0a9d48a89c779fd449c022e7/dfa4190bcf7943c0adbe20dff1496f42.html)), and agent attributes help distribute jobs. SAP Cloud ALM health monitoring reports Added Jobs and Jobs in Process, and counts Disconnected, Attended, Unattended and Test Agents ([SAP Cloud ALM](https://support.sap.com/en/alm/sap-cloud-alm/operations/expert-portal/health-monitoring/health-monitoring-setup-configuration/setup-spa.html)). Note the gap: that metric list doesn't include failed workflow instances, so someone also watches the Monitor tab.

#### The bridge to S/4HANA and ECC

Flexible workflow runs inside S/4HANA. In S/4HANA Cloud, SAP Business Workflow uses the SAP Workflow Management engine, and SAP Build Process Automation is the evolution of that service ([SAP Learning](https://learning.sap.com/courses/implementing-sap-s-4hana-cloud-public-edition/exploring-flexible-business-workflows_af2a653f-243c-487e-9def-843aa9c76ccc)). SAP connects the two worlds in three ways ([SAP Learning](https://learning.sap.com/courses/sap-workflow-overview-basics-strategy-and-extensibility/explaining-integration-between-sap-build-process-automation-and-s-4hana-sap-ecc_ae7610b1-0c49-4670-85a9-45e748bd4ee1)):

- **Extension steps** in SAP Business Workflow, for ECC and S/4HANA.
- **The in-app extension step** in Manage Workflows, only for flexible workflow in S/4HANA, not ECC.
- **Starting a process from custom code** in S/4HANA Cloud through communication scenario SAP_COM_0542.

The integration needs ABAP Platform 7.50 SP35 or higher. Whether a particular workflow scenario, such as purchase order approval, offers the in-app extension step on your release is something to confirm in your system.

```mermaid
sequenceDiagram
  participant B as Buyer
  participant S as S/4HANA flexible workflow
  participant P as Process on BTP
  participant A as Approver
  B->>S: Save PO above threshold
  S->>P: Extension step: check quote
  P-->>S: Result and evidence
  S->>A: Work item in My Inbox
  A->>S: Approve
```

### Build it yourself: Calder's process placement and tenant check

You will place Calder's eight process requests with a script that encodes the rules above, compare the result with a partner's proposal, check a draft SAP Build Process Automation tenant design against ten governance rules, fix the design, and write a decision document. Everything runs on your computer with no account.

```mermaid
flowchart LR
  I[--init] --> P[calder_processes.json]
  I --> T[calder_bpa_tenant.json]
  P --> S[process_placement.py]
  T --> S
  S --> O[placement and<br/>proposal comparison]
  S --> G[--tenant<br/>rules G01-G10]
  S --> W[--write]
  W --> M[calder_process_decisions.md]
```

**Before you start:** complete [Set up your computer for this course](https://erpfde.com/topics/set-up-your-computer/) and [Set up for Unit 21](https://erpfde.com/topics/set-up-for-unit-21/). This walkthrough doesn't repeat their steps.

> **Note** New words. A **process request** is a business team asking for an approval or automation. **JSON** is a text format for structured data. A **rule** here is a plain `if` in Python that turns SAP's guidance or a course policy into a decision. A **tenant** is your company's own subscription to SAP Build Process Automation in one BTP subaccount. An **exit code** is a number a program returns when it ends: 0 means success, other numbers mean a problem a pipeline can stop on.

#### What you need

- Python and your `orchestrate-course` folder with its `.venv`.
- No account. Everything is free.
- About 35 minutes.

#### Step 1: Open the course folder and turn on the virtual environment

1. Open VS Code, choose **File > Open Folder**, and open `orchestrate-course`.
2. Open a terminal: **Terminal > New Terminal**.
3. If the prompt doesn't start with `(.venv)`, turn it on:

   - **Windows (PowerShell):**

     ```powershell
     .venv\Scripts\Activate.ps1
     ```

   - **macOS / Linux:**

     ```bash
     source .venv/bin/activate
     ```

4. The `unit21` folder exists from the setup topic. If it doesn't, create it with `mkdir unit21`.

#### Step 2: Create the script

1. In VS Code, create a new file `unit21/process_placement.py`.
2. Paste this code and save. It uses only Python's built-in modules, so `requirements.txt` gets no new lines.

```python
"""Decide where each of Calder's approval and automation processes should live, and check the
SAP Build Process Automation tenant design before anything goes to production.

Usage (run from the course folder):
  python unit21/process_placement.py --init     write unit21/calder_processes.json and
                                                unit21/calder_bpa_tenant.json (the draft design)
  python unit21/process_placement.py            place every process and compare with the proposal
  python unit21/process_placement.py --tenant   check the tenant design against rules G01-G10
  python unit21/process_placement.py --write    write unit21/calder_process_decisions.md

Built-in modules only. No account, no network, no randomness. Calder Pumpworks is fictional;
processes, users, groups, environments and the partner's proposal are course values. The rules
restate SAP's learning content, product pages and a community post as read on 2026-11-27; rules
marked "course rule" are this course's choices, not SAP's.
"""
import argparse
import json
import sys
from datetime import date
from pathlib import Path

HERE = Path(__file__).resolve().parent
PROCESS_FILE = HERE / "calder_processes.json"
TENANT_FILE = HERE / "calder_bpa_tenant.json"
OUT_FILE = HERE / "calder_process_decisions.md"
TODAY = date(2026, 11, 27)

HOMES = {
    "POLICY FIRST": "No tool yet: the owners must agree the rule in one sentence",
    "INTEGRATION": "Integration Suite flow or a scheduled job; nobody decides, so no workflow",
    "KEEP IN ECC": "SAP Business Workflow in ECC until the system retires; no new investment",
    "AGENT + PROCESS": "Joule Studio agent plans the steps; the fixed approval is a process it calls",
    "PROCESS + BOT": "SAP Build Process Automation process with an unattended automation for the "
                     "system that has no API; retire the bot when an API appears",
    "FLEXIBLE WORKFLOW": "S/4HANA flexible workflow, configured in the system",
    "FLEXIBLE WORKFLOW + EXTENSION STEP": "S/4HANA flexible workflow keeps the approval; an "
                     "extension step calls a SAP Build Process Automation process for the part "
                     "S/4HANA can't do",
    "BUILD PROCESS AUTOMATION": "SAP Build Process Automation process (workflow, decision, forms)",
}


def place(p):
    """Return (home, reason). First matching rule wins."""
    systems = set(p["systems"])
    if not p["policy_agreed"]:
        return "POLICY FIRST", "the rule isn't agreed, and no tool can automate a rule nobody states"
    if not p["human_decision"]:
        return "INTEGRATION", "no person decides anything, so data movement is enough"
    retires = p.get("system_retires")
    if systems == {"ECC"} and retires and date.fromisoformat(retires) <= date(TODAY.year + 1, 12, 31):
        return "KEEP IN ECC", f"ECC retires on {retires}; a new build would live a few months"
    if p["steps_vary"]:
        return "AGENT + PROCESS", "the next step depends on what each case shows"
    if p["system_without_api"]:
        return "PROCESS + BOT", f"{p['system_without_api']} offers no API, only screens"
    only_s4 = systems == {"S4"}
    if only_s4 and p["flexible_workflow_scenario"]:
        if not p["reads_documents"] and not p["external_participants"]:
            return "FLEXIBLE WORKFLOW", "one S/4HANA document, rules on its own fields"
        return ("FLEXIBLE WORKFLOW + EXTENSION STEP",
                "the approval belongs to an S/4HANA document; only one step needs more")
    why = []
    if len(systems) > 1:
        why.append("spans " + ", ".join(sorted(systems)))
    if p["external_participants"]:
        why.append("people outside Calder take part")
    if p["reads_documents"]:
        why.append("reads documents")
    if not p["flexible_workflow_scenario"]:
        why.append("no S/4HANA workflow scenario covers it")
    return "BUILD PROCESS AUTOMATION", "; ".join(why)


PROCESSES = [
    {"id": "P01", "name": "PO approval above 25,000 USD (fit-gap R05)", "owner_team": "Purchasing",
     "systems": ["S4"], "human_decision": True, "policy_agreed": True, "steps_vary": False,
     "system_without_api": None, "flexible_workflow_scenario": True, "reads_documents": False,
     "external_participants": False, "runs_per_month": 40, "proposed": "BUILD PROCESS AUTOMATION"},
    {"id": "P02", "name": "PO approval with the supplier quote check (Unit 14)", "owner_team": "Purchasing",
     "systems": ["S4"], "human_decision": True, "policy_agreed": True, "steps_vary": False,
     "system_without_api": None, "flexible_workflow_scenario": True, "reads_documents": True,
     "external_participants": False, "runs_per_month": 120, "proposed": "BUILD PROCESS AUTOMATION"},
    {"id": "P03", "name": "New supplier onboarding with bank check", "owner_team": "Master data",
     "systems": ["S4", "SUPPLIER_PORTAL"], "human_decision": True, "policy_agreed": True,
     "steps_vary": False, "system_without_api": None, "flexible_workflow_scenario": False,
     "reads_documents": True, "external_participants": True, "runs_per_month": 6,
     "proposed": "BUILD PROCESS AUTOMATION"},
    {"id": "P04", "name": "Augsburg purchase requisition release in CP20", "owner_team": "Purchasing DE",
     "systems": ["ECC"], "human_decision": True, "policy_agreed": True, "steps_vary": False,
     "system_without_api": None, "flexible_workflow_scenario": False, "reads_documents": False,
     "external_participants": False, "system_retires": "2027-07-05", "runs_per_month": 90,
     "proposed": "BUILD PROCESS AUTOMATION"},
    {"id": "P05", "name": "Cost centers to SuccessFactors (I13)", "owner_team": "Controlling",
     "systems": ["S4", "SUCCESSFACTORS"], "human_decision": False, "policy_agreed": True,
     "steps_vary": False, "system_without_api": None, "flexible_workflow_scenario": False,
     "reads_documents": False, "external_participants": False, "runs_per_month": 30,
     "proposed": "BUILD PROCESS AUTOMATION"},
    {"id": "P06", "name": "Carrier invoices from carrier portals (I06)", "owner_team": "Accounts payable",
     "systems": ["S4", "CARRIER_PORTALS"], "human_decision": True, "policy_agreed": True,
     "steps_vary": False, "system_without_api": "CARRIER_PORTALS", "flexible_workflow_scenario": False,
     "reads_documents": True, "external_participants": False, "runs_per_month": 60,
     "proposed": "PROCESS + BOT"},
    {"id": "P07", "name": "Blocked supplier invoice triage (AGT_INV_TRIAGE)", "owner_team": "Accounts payable",
     "systems": ["S4"], "human_decision": True, "policy_agreed": True, "steps_vary": True,
     "system_without_api": None, "flexible_workflow_scenario": False, "reads_documents": False,
     "external_participants": False, "runs_per_month": 300, "proposed": "BUILD PROCESS AUTOMATION"},
    {"id": "P08", "name": "Sales director releasing credit blocks by phone (fit-gap R04)",
     "owner_team": "Credit", "systems": ["S4"], "human_decision": True, "policy_agreed": False,
     "steps_vary": False, "system_without_api": None, "flexible_workflow_scenario": True,
     "reads_documents": False, "external_participants": False, "runs_per_month": 25,
     "proposed": "BUILD PROCESS AUTOMATION"},
]

TENANT = {
    "company": "Calder Pumpworks (fictional)",
    "subaccount": "calder-ext-prod",
    "governance_rules": {"Create a Project": "Ungoverned", "Transport a Project": "Ungoverned"},
    "release_group": "BPA-RELEASE-MANAGERS",
    "support_group": "BTP-APP-SUPPORT",
    "bots_allowed_for": ["CARRIER_PORTALS"],
    "cloud_alm_health_monitoring": {"enabled": False, "alert_disconnected_agents": False},
    "note_3394899_checked_on": None,
    "environments": [
        {"name": "Public", "type": "public", "projects": ["supplier-onboarding"], "shares": [],
         "agents": []},
        {"name": "P2P Production", "type": "shared",
         "projects": ["po-quote-check", "carrier-invoices", "s4-po-screen-bot"],
         "shares": [
             {"principal": "BPA-RELEASE-MANAGERS", "kind": "group", "privileges": ["Deploy", "Administrate"]},
             {"principal": "integration.dev@calder-pumpworks.example", "kind": "user", "privileges": ["Deploy"]},
             {"principal": "BTP-APP-SUPPORT", "kind": "group", "privileges": ["Monitor", "View Logs"]}],
         "agents": ["RKBOT01"]},
    ],
    "projects": {
        "po-quote-check": {"process": "P02", "business_owner": "00100253", "bot_targets": []},
        "carrier-invoices": {"process": "P06", "business_owner": None, "bot_targets": ["CARRIER_PORTALS"]},
        "supplier-onboarding": {"process": "P03", "business_owner": "00100250", "bot_targets": []},
        "s4-po-screen-bot": {"process": "P01", "business_owner": "00100211", "bot_targets": ["S4"]},
    },
}


def load(path):
    if not path.exists():
        sys.exit(f"{path.name} not found. Run: python unit21/process_placement.py --init")
    return json.loads(path.read_text(encoding="utf-8"))


def check_tenant(t):
    """Return a list of (rule, verdict, message)."""
    out = []
    for rule_id, rule in (("G01", "Create a Project"), ("G02", "Transport a Project")):
        v = t["governance_rules"].get(rule)
        out.append((rule_id, "OK" if v == "Governed" else "FAIL",
                    f"governance rule '{rule}' is {v}" + ("" if v == "Governed" else "; set Governed")))
    envs = t["environments"]
    public = [e for e in envs if e["type"] == "public"]
    in_public = [p for e in public for p in e["projects"]]
    out.append(("G03", "FAIL" if in_public else "OK",
                f"production projects in the Public environment: {', '.join(in_public)}; move them to a shared environment"
                if in_public else "no production project in the Public environment"))
    bad = []
    for e in envs:
        for s in e["shares"]:
            if set(s["privileges"]) & {"Deploy", "Administrate"} and s["principal"] != t["release_group"]:
                bad.append(f"{s['principal']} in {e['name']}")
    out.append(("G04", "FAIL" if bad else "OK",
                "Deploy or Administrate outside the release group: " + "; ".join(bad) if bad
                else f"only {t['release_group']} deploys or administers"))
    miss = [e["name"] for e in envs if e["type"] == "shared" and e["projects"] and not any(
        s["principal"] == t["support_group"] and "Monitor" in s["privileges"] for s in e["shares"])]
    out.append(("G05", "FAIL" if miss else "OK",
                f"no Monitor share for {t['support_group']} in: {', '.join(miss)}" if miss
                else f"{t['support_group']} monitors every shared environment with projects"))
    deployed = [p for e in envs for p in e["projects"]]
    unknown = [p for p in deployed if p not in t["projects"]]
    no_owner = [p for p in deployed if p in t["projects"] and not t["projects"][p]["business_owner"]]
    msgs = []
    if unknown:
        msgs.append("not in the project register: " + ", ".join(unknown))
    if no_owner:
        msgs.append("no business owner: " + ", ".join(no_owner))
    out.append(("G06", "FAIL" if msgs else "OK", "; ".join(msgs) or "every deployed project has a business owner"))
    thin = []
    for e in envs:
        bots = [p for p in e["projects"] if t["projects"].get(p, {}).get("bot_targets")]
        if bots and len(e["agents"]) < 2:
            thin.append(f"{e['name']} runs bots on {len(e['agents'])} agent(s)")
    out.append(("G07", "WARN" if thin else "OK",
                "; ".join(thin) + "; one agent down stops every bot (course rule: 2)" if thin
                else "every environment with bots has at least 2 agents"))
    wrong = [f"{p} drives {x}" for p, d in t["projects"].items() if p in deployed
             for x in d["bot_targets"] if x not in t["bots_allowed_for"]]
    out.append(("G08", "FAIL" if wrong else "OK",
                "bot on a system with an API: " + "; ".join(wrong) + "; use the API or flexible workflow" if wrong
                else "bots only drive systems without an API"))
    mon = t["cloud_alm_health_monitoring"]
    ok = mon["enabled"] and mon["alert_disconnected_agents"]
    out.append(("G09", "OK" if ok else "FAIL",
                "Cloud ALM health monitoring on, alert on Disconnected Agents" if ok
                else "turn on Cloud ALM health monitoring and alert on Disconnected Agents"))
    shared_has_process = any(e["type"] == "shared" and e["projects"] for e in envs)
    checked = t.get("note_3394899_checked_on")
    out.append(("G10", "OK" if checked or not shared_has_process else "WARN",
                f"artifact support in shared environments checked on {checked}" if checked
                else "confirm in SAP Note 3394899 that shared environments take your artifacts "
                     "(processes, decisions, forms) on your release"))
    return out


def main():
    ap = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter)
    ap.add_argument("--init", action="store_true")
    ap.add_argument("--tenant", action="store_true")
    ap.add_argument("--write", action="store_true")
    a = ap.parse_args()

    if a.init:
        for path, data in ((PROCESS_FILE, {"company": "Calder Pumpworks (fictional)",
                                           "as_of": TODAY.isoformat(), "processes": PROCESSES}),
                           (TENANT_FILE, TENANT)):
            if path.exists():
                print(f"{path.name} exists; left as it is")
            else:
                path.write_text(json.dumps(data, indent=2) + "\n", encoding="utf-8")
                print(f"wrote {path.name}")
        return 0

    procs = load(PROCESS_FILE)["processes"]
    placed = [(p, *place(p)) for p in procs]
    if not a.tenant:
        print(f"Process placement for Calder Pumpworks (fictional), as of {TODAY}\n")
        print(f"{'ID':4} {'Home':36} {'Proposal':26} Reason")
        changed = 0
        for p, home, why in placed:
            mark = "" if home == p["proposed"] else " *"
            changed += bool(mark)
            print(f"{p['id']:4} {home:36} {p['proposed'][:24]:26} {why}{mark}")
        print(f"\n{changed} of {len(placed)} placements differ from the proposal (*).")
        count = {}
        for _, h, _ in placed:
            count[h] = count.get(h, 0) + 1
        print("By home: " + ", ".join(f"{h} {n}" for h, n in sorted(count.items())))

    findings = check_tenant(load(TENANT_FILE))
    if a.tenant or a.write:
        if a.tenant:
            print(f"Tenant design check: {load(TENANT_FILE)['subaccount']}\n")
            for rule, verdict, msg in findings:
                print(f"{rule}  {verdict:4}  {msg}")
        tally = {v: sum(1 for _, x, _ in findings if x == v) for v in ("OK", "WARN", "FAIL")}
        if a.tenant:
            print(f"\n{tally['OK']} OK, {tally['WARN']} WARN, {tally['FAIL']} FAIL")

    if a.write:
        lines = ["# Where Calder's processes live", "",
                 f"Calder Pumpworks (fictional). Generated by `process_placement.py` on {TODAY}. "
                 "Course values, not a real system.", "", "## Placement", "",
                 "| ID | Process | Owner team | Home | Reason |", "| --- | --- | --- | --- | --- |"]
        for p, home, why in placed:
            lines.append(f"| {p['id']} | {p['name']} | {p['owner_team']} | {home} | {why} |")
        lines += ["", "## Homes", ""] + [f"- **{h}**: {d}" for h, d in HOMES.items()
                                         if any(h == x for _, x, _ in placed)]
        lines += ["", "## Tenant design check (calder-ext-prod)", "",
                  "| Rule | Verdict | Finding |", "| --- | --- | --- |"]
        lines += [f"| {r} | {v} | {m} |" for r, v, m in findings]
        lines += ["", "## Decision record: where an approval lives", "",
                  "**Context.** Calder's approvals sit in S/4HANA, in ECC until July 2027, and in "
                  "requests for SAP Build Process Automation. A low-code tool makes every approval "
                  "look like a new process.", "",
                  "**Options.** A: every approval in SAP Build Process Automation. B: S/4HANA flexible "
                  "workflow first, SAP Build Process Automation where a process crosses systems, reads "
                  "documents or includes outsiders, an agent only where steps vary. C: custom code on BTP.", "",
                  "**Decision.** B, applied by the rules in `process_placement.py`.", "",
                  "**Consequences.** Tasks arrive from two engines, so the inbox users work in is a "
                  "design decision; bots only for systems without an API, each with a retirement "
                  "condition; every production project in a shared environment with a business owner, "
                  "the release group deploying and application support monitoring.", ""]
        OUT_FILE.write_text("\n".join(lines), encoding="utf-8")
        print(f"\nwrote {OUT_FILE.name}")
    return 2 if any(v == "FAIL" for _, v, _ in findings) and a.tenant else 0


if __name__ == "__main__":
    sys.exit(main())
```

#### Step 3: Write the sample files

1. Run:

   ```bash
   python unit21/process_placement.py --init
   ```

2. Expected:

   ```text
   wrote calder_processes.json
   wrote calder_bpa_tenant.json
   ```

3. Open `unit21/calder_processes.json`. Each process has the facts a functional consultant supplies: systems touched, whether a person decides, whether the rule is agreed, whether a standard S/4HANA workflow scenario covers it, whether it reads documents or includes outsiders, and the partner's `proposed` home.

> **Note** The eight requests reuse Calder's earlier topics: R04 and R05 from the [fit-to-standard topic](https://erpfde.com/topics/fit-to-standard-and-extension-choices/), the quote check from the [Unit 14 topic](https://erpfde.com/topics/sap-build-process-automation-with-ai/), interfaces I06 and I13 from the [integration platform topic](https://erpfde.com/topics/integration-platform-and-clean-core/), and the invoice triage agent from earlier units. All values are course values for a fictional company.

#### Step 4: Place the processes

1. Run:

   ```bash
   python unit21/process_placement.py
   ```

2. Expected:

   ```text
   Process placement for Calder Pumpworks (fictional), as of 2026-11-27

   ID   Home                                 Proposal                   Reason
   P01  FLEXIBLE WORKFLOW                    BUILD PROCESS AUTOMATION   one S/4HANA document, rules on its own fields *
   P02  FLEXIBLE WORKFLOW + EXTENSION STEP   BUILD PROCESS AUTOMATION   the approval belongs to an S/4HANA document; only one step needs more *
   P03  BUILD PROCESS AUTOMATION             BUILD PROCESS AUTOMATION   spans S4, SUPPLIER_PORTAL; people outside Calder take part; reads documents; no S/4HANA workflow scenario covers it
   P04  KEEP IN ECC                          BUILD PROCESS AUTOMATION   ECC retires on 2027-07-05; a new build would live a few months *
   P05  INTEGRATION                          BUILD PROCESS AUTOMATION   no person decides anything, so data movement is enough *
   P06  PROCESS + BOT                        PROCESS + BOT              CARRIER_PORTALS offers no API, only screens
   P07  AGENT + PROCESS                      BUILD PROCESS AUTOMATION   the next step depends on what each case shows *
   P08  POLICY FIRST                         BUILD PROCESS AUTOMATION   the rule isn't agreed, and no tool can automate a rule nobody states *

   6 of 8 placements differ from the proposal (*).
   By home: AGENT + PROCESS 1, BUILD PROCESS AUTOMATION 1, FLEXIBLE WORKFLOW 1, FLEXIBLE WORKFLOW + EXTENSION STEP 1, INTEGRATION 1, KEEP IN ECC 1, POLICY FIRST 1, PROCESS + BOT 1
   ```

3. Read P02 closely. The [Unit 14 topic](https://erpfde.com/topics/sap-build-process-automation-with-ai/) built the quote check as one process on BTP, and that works. The rule here prefers to keep the approval with the purchase order in S/4HANA and call the quote check as an extension step, so the approval control stays in one place. That holds only if your release offers the in-app extension step for the purchase order scenario. If it doesn't, P02 falls back to a whole process on BTP, and the decision record says so.

> **Note** These placements come from synthetic data and course rules. They show the method, not a recommendation for a real company.

#### Step 5: Check the draft tenant design

1. Open `unit21/calder_bpa_tenant.json`. It describes the production tenant in subaccount `calder-ext-prod` from the [account model topic](https://erpfde.com/topics/btp-account-model/): governance rules, environments with their shares and agents, and a register of projects with business owners.
2. Run:

   ```bash
   python unit21/process_placement.py --tenant
   ```

3. Expected (exit code 2, because rules fail):

   ```text
   Tenant design check: calder-ext-prod

   G01  FAIL  governance rule 'Create a Project' is Ungoverned; set Governed
   G02  FAIL  governance rule 'Transport a Project' is Ungoverned; set Governed
   G03  FAIL  production projects in the Public environment: supplier-onboarding; move them to a shared environment
   G04  FAIL  Deploy or Administrate outside the release group: integration.dev@calder-pumpworks.example in P2P Production
   G05  OK    BTP-APP-SUPPORT monitors every shared environment with projects
   G06  FAIL  no business owner: carrier-invoices
   G07  WARN  P2P Production runs bots on 1 agent(s); one agent down stops every bot (course rule: 2)
   G08  FAIL  bot on a system with an API: s4-po-screen-bot drives S4; use the API or flexible workflow
   G09  FAIL  turn on Cloud ALM health monitoring and alert on Disconnected Agents
   G10  WARN  confirm in SAP Note 3394899 that shared environments take your artifacts (processes, decisions, forms) on your release

   1 OK, 2 WARN, 7 FAIL
   ```

4. Read each failure as a design review would:

   | Rule | Source | Why it matters |
   | --- | --- | --- |
   | G01, G02 | SAP's governance rules | Ungoverned lets anyone create and transport projects |
   | G03 | Course rule from SAP's description | Every tenant user with access reaches the Public environment |
   | G04 | Course rule (separation of duties) | The developer who builds a process shouldn't deploy it to production |
   | G05 | Course rule | Someone needs the Monitor privilege to see failed instances |
   | G06 | Course rule | A process without a business owner has nobody to change its rule |
   | G07 | Course rule | Two agents, so one machine down doesn't stop all bots |
   | G08 | Course rule (clean core) | Bots only for systems without an API |
   | G09 | SAP Cloud ALM metric | A disconnected agent stops bots silently |
   | G10 | SAP Note named in SAP's help | The note lists which artifacts environments support |

#### Step 6: Fix the design

1. Replace the whole content of `unit21/calder_bpa_tenant.json` with this and save. It sets both rules to Governed, moves supplier onboarding into its own shared environment, removes the developer's deploy right, names the AP supervisor `00100244` as the owner of the carrier invoice process, retires the screen bot (P01 belongs in flexible workflow anyway) and turns on monitoring.

```json
{
  "company": "Calder Pumpworks (fictional)",
  "subaccount": "calder-ext-prod",
  "governance_rules": {
    "Create a Project": "Governed",
    "Transport a Project": "Governed"
  },
  "release_group": "BPA-RELEASE-MANAGERS",
  "support_group": "BTP-APP-SUPPORT",
  "bots_allowed_for": [
    "CARRIER_PORTALS"
  ],
  "cloud_alm_health_monitoring": {
    "enabled": true,
    "alert_disconnected_agents": true
  },
  "note_3394899_checked_on": null,
  "environments": [
    {
      "name": "Public",
      "type": "public",
      "projects": [],
      "shares": [],
      "agents": []
    },
    {
      "name": "P2P Production",
      "type": "shared",
      "projects": [
        "po-quote-check",
        "carrier-invoices"
      ],
      "shares": [
        {
          "principal": "BPA-RELEASE-MANAGERS",
          "kind": "group",
          "privileges": [
            "Deploy",
            "Administrate"
          ]
        },
        {
          "principal": "BTP-APP-SUPPORT",
          "kind": "group",
          "privileges": [
            "Monitor",
            "View Logs"
          ]
        }
      ],
      "agents": [
        "RKBOT01"
      ]
    },
    {
      "name": "Supplier Onboarding Production",
      "type": "shared",
      "projects": [
        "supplier-onboarding"
      ],
      "shares": [
        {
          "principal": "BPA-RELEASE-MANAGERS",
          "kind": "group",
          "privileges": [
            "Deploy",
            "Administrate"
          ]
        },
        {
          "principal": "BTP-APP-SUPPORT",
          "kind": "group",
          "privileges": [
            "Monitor",
            "View Logs"
          ]
        }
      ],
      "agents": []
    }
  ],
  "projects": {
    "po-quote-check": {
      "process": "P02",
      "business_owner": "00100253",
      "bot_targets": []
    },
    "carrier-invoices": {
      "process": "P06",
      "business_owner": "00100244",
      "bot_targets": [
        "CARRIER_PORTALS"
      ]
    },
    "supplier-onboarding": {
      "process": "P03",
      "business_owner": "00100250",
      "bot_targets": []
    }
  }
}
```

2. Run the check again:

   ```bash
   python unit21/process_placement.py --tenant
   ```

3. Expected (exit code 0):

   ```text
   Tenant design check: calder-ext-prod

   G01  OK    governance rule 'Create a Project' is Governed
   G02  OK    governance rule 'Transport a Project' is Governed
   G03  OK    no production project in the Public environment
   G04  OK    only BPA-RELEASE-MANAGERS deploys or administers
   G05  OK    BTP-APP-SUPPORT monitors every shared environment with projects
   G06  OK    every deployed project has a business owner
   G07  WARN  P2P Production runs bots on 1 agent(s); one agent down stops every bot (course rule: 2)
   G08  OK    bots only drive systems without an API
   G09  OK    Cloud ALM health monitoring on, alert on Disconnected Agents
   G10  WARN  confirm in SAP Note 3394899 that shared environments take your artifacts (processes, decisions, forms) on your release

   8 OK, 2 WARN, 0 FAIL
   ```

4. Two warnings are left on purpose. G07 is the exercise. G10 stays until someone reads SAP Note 3394899 on a real tenant and records the date in `note_3394899_checked_on`. A warning you can't clear from your desk is a valid result: it goes into the decision record as an open item.

#### Step 7: Write the decision document

1. Run:

   ```bash
   python unit21/process_placement.py --write
   ```

2. The last line reads `wrote calder_process_decisions.md`. Open `unit21/calder_process_decisions.md`. It holds the placement table, the homes, the tenant check and a short architecture decision record.
3. Save your work with Git:

   ```bash
   git add unit21/process_placement.py unit21/calder_processes.json unit21/calder_bpa_tenant.json unit21/calder_process_decisions.md
   git commit -m "Unit 21: process placement and BPA tenant check"
   ```

#### What the code does

| Part | What it does |
| --- | --- |
| `place()` | Applies the placement rules in order and returns the first home that fits, with a reason |
| `PROCESSES` | Calder's eight requests with the facts a placement needs and the partner's proposal |
| `TENANT` | The draft production tenant design, with deliberate errors |
| `check_tenant()` | Rules G01 to G10: governance rules, environments, privileges, owners, agents, bots, monitoring, the SAP Note check |
| `--init` | Writes the two JSON files, never overwriting yours |
| `--tenant` | Prints the check and returns exit code 2 if any rule fails, so a pipeline can stop on it |
| `--write` | Writes the Markdown decision document |

#### If something goes wrong

| What you see | What it means | What to do |
| --- | --- | --- |
| `python: command not found` or `'python' is not recognized` | Python isn't on your path, or the virtual environment is off | Turn on `.venv` (Step 1), or use `python3` on macOS/Linux |
| `calder_processes.json not found` | You skipped `--init` | Run `python unit21/process_placement.py --init` |
| `json.decoder.JSONDecodeError` | A comma or bracket is wrong after an edit | Paste the file again, or check the line number in the message |
| `KeyError: 'business_owner'` | A project in the register lost a field | Every project needs `process`, `business_owner` and `bot_targets` |
| `--init` says "exists; left as it is" | Your files are kept on purpose | Delete a file first if you want the draft back |
| Output differs from the text above | You edited the files or the script | Compare with the code and files in this page |

This script needs no library and no network, so there is no missing-library, key or proxy problem to hit.

### The SAP way

SAP's materials, as read on 27 November 2026, give the architect these levers:

- **Flexible workflow first for S/4HANA documents.** SAP ships workflow scenario templates for configuration experts, with work items in My Inbox ([SAP Learning](https://learning.sap.com/courses/implementing-sap-s-4hana-cloud-public-edition/exploring-flexible-business-workflows_af2a653f-243c-487e-9def-843aa9c76ccc)).
- **Extension steps to reach BTP.** For SAP Business Workflow in ECC and S/4HANA, and the in-app extension step for flexible workflow in S/4HANA only. ABAP Platform 7.50 SP35 or higher ([SAP Learning](https://learning.sap.com/courses/sap-workflow-overview-basics-strategy-and-extensibility/explaining-integration-between-sap-build-process-automation-and-s-4hana-sap-ecc_ae7610b1-0c49-4670-85a9-45e748bd4ee1)).
- **SAP Build Process Automation for cross-system work.** Processes, decisions, forms, bots, Actions, API triggers via event mesh and a Task center ([features](https://www.sap.com/mena/products/technology-platform/process-automation/features.html)).
- **Integration Suite where no user decides.** SAP's workflow overview places integration without user decisions in SAP Integration Suite ([SAP Learning](https://learning.sap.com/courses/sap-workflow-overview-basics-strategy-and-extensibility/explaining-workflow-at-sap-and-in-sap-s-4hana_fbd9ae71-f66e-4344-b4de-1c2f80ed8935)).
- **Governance and environments.** The Control Tower's rules, shared environments and sharing privileges ([SAP Learning](https://learning.sap.com/courses/sap-build-developer/exploring-sap-build-governance_a7c2f3c7-1fe1-4003-864c-135ec1c47b7b)).
- **Operations in SAP Cloud ALM.** Health monitoring for jobs and agents ([SAP Cloud ALM](https://support.sap.com/en/alm/sap-cloud-alm/operations/expert-portal/health-monitoring/health-monitoring-setup-configuration/setup-spa.html)).

Licensing: see the plans recorded in the [Unit 14 topic](https://erpfde.com/topics/sap-build-process-automation-with-ai/) and reopen SAP's pricing page before you budget. Projects move between Calder's Ext Dev, Ext Test and Ext Prod subaccounts through the SAP Content Agent service and SAP Cloud Transport Management, where imported content is approved ([SAP Help Portal](https://help.sap.com/docs/PROCESS_AUTOMATION/a331c4ef0a9d48a89c779fd449c022e7/f778a164c9ab4723a2b7e1dec67df377.html)); the "Transport a Project" governance rule adds an approval before that.

### Build vs. SAP

| Need | Use | Not |
| --- | --- | --- |
| Approve one S/4HANA document on its fields | Flexible workflow | A process on BTP that copies the document's data |
| Add one cross-system step to an S/4HANA approval | Flexible workflow with an extension step | Custom code in the core |
| Cross-system process with outsiders and forms | SAP Build Process Automation | A CAP app built from scratch, unless the UI is the product |
| Heavy custom UI or complex domain logic | A CAP application, as in the [CAP topic](https://erpfde.com/topics/cap-for-architects/), which can still start a process | Forms stretched past what they do well |
| Varying steps, judgment between tools | An agent that calls a fixed process for the approval | An agent that approves by itself |
| Moving data with no decision | Integration Suite | A workflow with no human step |

### Architecture view

**Where it sits.** The S/4HANA approvals stay in `CP10`'s system. SAP Build Process Automation runs in the Ext subaccounts of the [account model](https://erpfde.com/topics/btp-account-model/), one tenant per stage, with production processes in shared environments per business area. It reaches S/4HANA through destinations and the Cloud Connector set up in the [connectivity topic](https://erpfde.com/topics/btp-connectivity/), and bots run on desktop agents on Calder machines.

```mermaid
flowchart LR
  subgraph S4[S/4HANA CP10]
    FW[Flexible workflow]
    MI[My Inbox]
  end
  subgraph BTP[Ext Prod subaccount]
    P2P[Env: P2P Production]
    SUP[Env: Supplier Onboarding]
    TC[Task center]
  end
  FW -->|extension step| P2P
  P2P -->|Actions via destination| S4
  SUP --> PORTAL[Supplier portal]
  AG[Desktop agents RKBOT01] --> P2P
  AG --> CARR[Carrier portals]
  ALM[SAP Cloud ALM] -.health.-> BTP
```

**Non-functional requirements.**

| Requirement | Typical target at Calder | What breaks if missed |
| --- | --- | --- |
| Security | Developers can't deploy to production; only the release group can | A process change reaches production unreviewed |
| Availability of bots | Two agents per environment with unattended bots | One machine reboot stops carrier invoices for a day |
| Volume | Hundreds of process instances a month (P02 120, P07 300) | Little; volume rarely decides placement here |
| Latency | An approval waits for a person, minutes to days | Nothing technical; slow approvers are a process problem |
| Cost | One builder per process team, participants for approvers; bots only where needed | Licences grow with every process built by habit |

**Integration and identity.** Approvers sign in through Calder's identity provider as in the [security model topic](https://erpfde.com/topics/btp-security-model/). Processes call S/4HANA through destinations; an action that changes S/4HANA data should run as the approving user where the API allows, not a shared technical user, so the change log shows who decided. Bots run with their own technical credentials on systems that have no API, which is why their list is short and reviewed.

**The decision to record.**

- **Context.** A partner proposed SAP Build Process Automation for every approval and automation request.
- **Options.** A: everything in SAP Build Process Automation. B: placement by rule, flexible workflow first. C: custom code on BTP.
- **Decision.** B, with the rules in `process_placement.py`.
- **Consequences.** Tasks come from two engines, so the approvers' inbox is a design decision. Every production project sits in a shared environment with a business owner. Bots need a retirement condition.

**What a design review will ask.**

1. Which approvals run in S/4HANA and which on BTP, and who decided each?
2. Who can deploy to production, and is that a different person from the builder?
3. What happens to running instances when a new version is deployed?
4. Which bots drive screens, and what is each bot's retirement condition?
5. Where do approvers find their tasks?

### Production concerns

- **Security and authorizations.** Assign ProcessAutomationAdmin to the BTP platform administrators only. Builders get ProcessAutomationDeveloper in development; production deploy rights go to a release group. Approval steps must not let the requester approve their own case; test that in the process, not only in role design ([roles topic](https://erpfde.com/topics/roles-and-authorization-design/)).
- **Change and versions.** Release and deploy are separate steps. In a shared environment, deploying a new version undeploys the old one, so plan what happens to instances already running. Test that before the first change, not during it.
- **Operations.** Give application support the Monitor and View Logs privileges in every production environment. Turn on SAP Cloud ALM health monitoring and alert on Disconnected Agents. Watch failed workflow instances in the Monitor tab, since the Cloud ALM metric list covers jobs and agents.
- **Clean core.** Prefer flexible workflow and extension steps over custom code in S/4HANA. Bots on S/4HANA screens are a sign an API or workflow scenario was missed.
- **Cost.** Each process adds licences, monitoring and retesting. The placement rules exist to keep that list short.

### Where AI fits

SAP's AI features for this product, decision generation, document extraction and Joule for developers, are covered with their status and terms in the [Unit 14 topic](https://erpfde.com/topics/sap-build-process-automation-with-ai/). For the architect, AI changes three things. Joule can draft a process in minutes, so placement and governance rules matter more, not less. Agents become a new consumer: an agent should call a fixed process for the approval rather than approve, as in the [human approval topic](https://erpfde.com/topics/human-approval-in-ai-workflows/). And SAP lists agentic workflows and Model Context Protocol among the product's features, so check each AI step's status and data path in a design review like any other integration.

### Pitfalls

- **Building by habit.** The tool is open in front of the team, so every request becomes a process. Run the placement first.
- **Production in the Public environment.** It is the default and open to every tenant user with access.
- **Builders who deploy.** Convenient in development, a control gap in production.
- **Bots on S/4HANA screens.** They break with the next screen change; use the API.
- **One agent.** A single machine reboot stops every unattended bot until someone notices.
- **Two approvals for one control.** Half the POs approved in S/4HANA and half in BTP confuses auditors; keep one home per control.
- **Rebuilding what retires.** Spending on ECC workflows months before the migration.

### Exercise

Place one more request and clear the agent warning.

1. Open `unit21/calder_processes.json`.
2. Add this entry at the end of the `processes` list. Put a comma after the closing `}` of P08 first:

   ```json
   {"id": "P09", "name": "EP-900 design approval by Brennock (CP-26-ENG01 milestone 1)", "owner_team": "Engineering",
    "systems": ["S4"], "human_decision": true, "policy_agreed": true, "steps_vary": false,
    "system_without_api": null, "flexible_workflow_scenario": false, "reads_documents": true,
    "external_participants": true, "runs_per_month": 2, "proposed": "FLEXIBLE WORKFLOW"}
   ```

3. Run `python unit21/process_placement.py`. Expected, near the end:

   ```text
   P09  BUILD PROCESS AUTOMATION             FLEXIBLE WORKFLOW          people outside Calder take part; reads documents; no S/4HANA workflow scenario covers it *

   7 of 9 placements differ from the proposal (*).
   ```

4. Open `unit21/calder_bpa_tenant.json` and add a second agent to P2P Production: change `"agents": ["RKBOT01"]` to `"agents": ["RKBOT01", "RKBOT02"]`.
5. Run `python unit21/process_placement.py --tenant`. Expected last line: `9 OK, 1 WARN, 0 FAIL`.
6. Decide which shared environment P09's project goes into, and who owns it. Add it to the tenant file's `projects` register and to that environment's `projects` list, then run the check again.
7. Run `python unit21/process_placement.py --write`. The decision document feeds [observability on BTP](https://erpfde.com/topics/btp-observability/) and [CI/CD and transport management on BTP](https://erpfde.com/topics/btp-cicd-and-transport/).

**Done when** `calder_process_decisions.md` places P09 in SAP Build Process Automation with its reason, the tenant check shows only the G10 warning, and P09's project has an environment and a business owner.

### Check yourself

1. In the placement rules, why does "no agreed rule" come before every tool?
   - A. No tool can automate a rule the owners haven't stated
   - B. Policy questions are cheaper to log than technical ones
   - C. SAP Build Process Automation refuses decisions without a policy
   - D. Flexible workflow needs a policy document to be configured

   Answer: A. A process encodes a rule. If the business can't state it in one sentence, any build will encode someone's guess, so P08 goes back to its owners.

2. P02, the PO approval with a quote check, lands on "flexible workflow + extension step". What has to be true for that to work?
   - A. The quote check must run as an unattended bot on the S/4HANA screen
   - B. The approval must move to SAP Build Process Automation's Task center
   - C. The release must offer the in-app extension step for the PO scenario
   - D. ECC must call the extension step before S/4HANA approves the order

   Answer: C. SAP documents the in-app extension step for flexible workflow in S/4HANA, and the integration needs ABAP Platform 7.50 SP35 or higher. Whether a given scenario offers it on your release is checked in the system; otherwise P02 falls back to a whole process on BTP.

3. What does "Release" do in a SAP Build Process Automation project?
   - A. Makes the process available to approvers in production
   - B. Freezes a snapshot with a version number that can then be deployed
   - C. Moves the project from the Public to a shared environment
   - D. Sends a governance request to the tenant administrator

   Answer: B. Release creates a versioned snapshot, 1.0.0 the first time, and only a released version can be deployed. Deploying is the separate step that makes it available to run.

4. The tenant check flags G03: a production project sits in the Public environment. Why is that a problem?
   - A. The Public environment can't run unattended automations
   - B. Projects in the Public environment can't be monitored at all
   - C. The Public environment only accepts released versions 1.0.0
   - D. Every tenant user with access reaches the Public environment

   Answer: D. SAP describes the Public environment as protected at tenant level, so every tenant user with access reaches it. Shared environments let you grant Monitor, Deploy or Administrate to named users or groups.

5. Why does rule G04 refuse a Deploy share for integration.dev@ in P2P Production?
   - A. Developers can't hold the ProcessAutomationDeveloper role there
   - B. The builder of a process shouldn't also put it into production
   - C. Deploy privileges can only be given to groups, never to users
   - D. Shared environments allow one Deploy share at a time

   Answer: B. It is a course rule for separation of duties: a release group deploys, so a change gets a second person before production. SAP's sharing does allow users as well as groups; the rule is a control choice.

6. Calder's carrier invoices come from portals with no API. Which design follows the rules?
   - A. An agent that reads each portal and approves the invoice itself
   - B. A flexible workflow that logs in to each portal from S/4HANA
   - C. One attended bot that an AP clerk starts every morning by hand
   - D. A process with an unattended bot, two agents and a retirement date

   Answer: D. A bot is the right tool only where a system offers screens and no API. Two agents keep the bot running if one machine drops, and the retirement condition stops the bot outliving the day a carrier offers an API.

7. SAP Cloud ALM's health metrics for this product cover jobs and agents. What else must operations watch?
   - A. The number of builder licences used each month
   - B. The version number of every released project
   - C. Failed workflow instances in the Monitor tab
   - D. The governance requests that are still pending

   Answer: C. The Cloud ALM metric list for SAP Build Process Automation has Added Jobs, Jobs in Process and agent counts, but no failed workflow instances. Application support needs the Monitor privilege and a habit of checking Process and Workflow Instances.

8. An agent triages blocked invoices and wants to release one. How should the design handle the release?
   - A. Give the agent the approver's role so it can release directly
   - B. Have the agent call a fixed process in which a person approves
   - C. Let the agent write the release into S/4HANA tables at night
   - D. Move the release into a bot that clicks the release button

   Answer: B. The agent plans the varying steps; the approval is a fixed control with a named person. That keeps the control where auditors expect it and the agent out of the decision.

## Sources

- [SAP Build Process Automation features (sap.com, MENA region page, read 2026-11-27)](https://www.sap.com/mena/products/technology-platform/process-automation/features.html): Workflow orchestration with agentic, deterministic and hybrid workflows; automation editor and recorder; attended and unattended bots; add-on by UiPath; template-based document processing and LLM-based extraction; Joule for developers; Actions, Model Context Protocol, UI-based integration, API-based process triggers delivered via event mesh; Task center, guided experiences deployed to SAP Build Work Zone, intelligent recommendations for approval tasks, process visibility dashboards
- [Exploring SAP Build Governance (SAP Learning)](https://learning.sap.com/courses/sap-build-developer/exploring-sap-build-governance_a7c2f3c7-1fe1-4003-864c-135ec1c47b7b): Control Tower > Tenant Configuration > Governance Rules: 'Create a Project' and 'Transport a Project', each Governed or Ungoverned; Governance Requests; governance projects deployed in the Governance environment; a destination for OAuth2 User Token Exchange allow-listed there; ProcessAutomationAdmin, ProcessAutomationDeveloper and ProcessAutomationParticipant roles; Public and shared environments; sharing privileges Monitor, View Logs, Deploy, Execute, Administrate, Supervise
- [SAP Build Process Automation: Introducing Environments (SAP Community, January 2024)](https://community.sap.com/t5/application-development-and-automation-blog-posts/sap-build-process-automation-introducing-environments/ba-p/13574458): An environment is a virtual location in the subscription where projects are deployed; Public environment by default, shared environments per business area; Deploy, Upgrade, Redeploy, Downgrade; deploying to a shared environment undeploys the previous version; agents assigned per environment; at the time of writing processes, forms, decisions and workflow definitions were not yet available in shared environments, with SAP Note 3394899 named for the current list
- [Run the Business Process (SAP Developers tutorial, read 2026-11-27)](https://developers.sap.com/tutorials/spa-run-process): Release creates a version or snapshot (1.0.0 the first time); only a released version can be deployed; released or deployed projects can't be edited; running instances under Monitor > Process and Workflow Instances
- [Environments (SAP Help Portal, SAP Build Process Automation, read 2026-11-27)](https://help.sap.com/docs/PROCESS_AUTOMATION/a331c4ef0a9d48a89c779fd449c022e7/dfa4190bcf7943c0adbe20dff1496f42.html): Shared and public environments; each environment's views include Agent Management, Triggers, API Keys and Processes and Workflows (deployed processes and workflow definitions); points to SAP Note 3394899 on the availability of environments
- [Transport a Project (SAP Help Portal, SAP Build Process Automation, read 2026-11-27)](https://help.sap.com/docs/PROCESS_AUTOMATION/a331c4ef0a9d48a89c779fd449c022e7/f778a164c9ab4723a2b7e1dec67df377.html): Projects move across subaccounts with the SAP Content Agent service and SAP Cloud Transport Management; imported content is approved in Cloud Transport Management
- [Health Monitoring for SAP Build Process Automation (SAP Cloud ALM expert portal)](https://support.sap.com/en/alm/sap-cloud-alm/operations/expert-portal/health-monitoring/health-monitoring-setup-configuration/setup-spa.html): Metrics Added Jobs and Jobs in Process (distribution); Disconnected Agents, Attended Agents, Unattended Agents and Test Agents (agents)
- [Explaining Integration Between SAP Build Process Automation and S/4HANA / SAP ECC (SAP Learning)](https://learning.sap.com/courses/sap-workflow-overview-basics-strategy-and-extensibility/explaining-integration-between-sap-build-process-automation-and-s-4hana-sap-ecc_ae7610b1-0c49-4670-85a9-45e748bd4ee1): Integration available for ABAP Platform 7.50 SP35 and higher; extension steps for SAP Business Workflow in ECC and S/4HANA; the in-app extension step in Manage Workflows only for flexible workflow in S/4HANA; communication scenario SAP_COM_0542 to start a workflow from custom code in S/4HANA Cloud; Process Visibility for end-to-end monitoring
- [Exploring Flexible Business Workflows (SAP Learning, S/4HANA Cloud Public Edition course)](https://learning.sap.com/courses/implementing-sap-s-4hana-cloud-public-edition/exploring-flexible-business-workflows_af2a653f-243c-487e-9def-843aa9c76ccc): SAP provides workflow scenario templates configured by line-of-business configuration experts; work items appear in My Inbox; SAP Business Workflow in S/4HANA Cloud uses the SAP Workflow Management engine; SAP Build Process Automation is the evolution of SAP Workflow Management and SAP Intelligent RPA; choose the option that is more efficient to implement and easier to maintain long-term
- [Explaining Workflow at SAP and in SAP S/4HANA (SAP Learning)](https://learning.sap.com/courses/sap-workflow-overview-basics-strategy-and-extensibility/explaining-workflow-at-sap-and-in-sap-s-4hana_fbd9ae71-f66e-4344-b4de-1c2f80ed8935): SAP Business Workflow and flexible workflow in S/4HANA; SAP Build Process Automation on BTP for process builder, decisions, automations and managing workflows; Integration Suite for integration without user decisions
