Relay and runner
Two features need a small iFlow in your own tenant: the relay forwards Test Studio calls through the Cloud Connector into the on-premise network, and the Groovy Runner runs a script on the real CPI runtime. Both are optional. iFlowTailor never imports or deploys them itself – you do, and you decide on which tenant.
- Relay
- Community · iFlow
IFT_Relay, address/iflowtailor/relay - Groovy Runner
- Pro · iFlow
IFT_GroovyRunner, address/iflowtailor/runner - Access
- service key of the Process Integration Runtime, plan
integration-flow, roleESBMessaging.send - Package
iFlowTailor Helpers, built by hand (about 10 minutes)
When you need which helper iFlow
| Relay | Groovy Runner | |
|---|---|---|
| Purpose | Test Studio calls targets in the on-premise network through the Cloud Connector, without a VPN. | A Groovy script runs on the real CPI runtime against a sample body, headers and properties – without a deploy-and-test cycle. |
| Without the helper iFlow | Test Studio sends directly from the browser (route Direct). | The Groovy Runner cannot be used. |
| Edition | Community | from Pro |
| Tenant | Any tenant that reaches the Cloud Connector. | Dev and test tenants only. |
Access: one service key for both
Both helper iFlows accept only OAuth tokens from a service key of the Process Integration Runtime.
- In SAP BTP, create an instance of the Process Integration Runtime service with plan
integration-flowand roleESBMessaging.send. - Create a service key for it and copy the JSON.
- In Test Studio, in the Library on the Auth tab, paste it into the field “Service key (JSON) of the “Process Integration Runtime” instance, plan integration-flow” and click Save service key. The extension asks for permission for the token and runtime hosts.
- It then says “Service key for <host> stored (shared with relay and Groovy Runner).”
The service key is stored encrypted in the extension’s local vault (vault) and is never exported.
Setting up the relay
- Create the package
iFlowTailor Helpersand the iFlowIFT_Relayin it. - Sender: HTTPS adapter with address
/iflowtailor/relay, authorization User Role withESBMessaging.send, CSRF protection off. Under Runtime Configuration, enterX-IFT-.*|Content-Type|Acceptin Allowed Header(s). - Content Modifier: property
ALLOWED_TARGETSas an externalized parameter. - Script
prepareRelay.groovy, followed by a Router on the proxy type with the branchesOnPremiseandInternet. - One Request Reply with an HTTP receiver per branch: method Dynamic, authentication None, proxy type On-Premise (with location ID) or Internet, Throw Exception on Failure off.
- Script
finishRelay.groovyafter the branches merge. - Set the
ALLOWED_TARGETSparameter when deploying, then deploy. Log level Info, not Trace, so that no payloads are stored in the tenant. - In Test Studio, choose Via relay (Cloud Connector) as the Route and call an allowed target with
GET. As the URL you enter the virtual host from the Cloud Connector.
As a check, call a target that is not allowed once: the relay must reject it with SecurityException.
Relay security
- Allowlist:
ALLOWED_TARGETSis a regular expression, such as^http://(s4-virtual|erp-virtual):\d+/sap/.*$. Only matching targets are called. If the parameter is empty, the relay rejects every request – without an allowlist it would be an open proxy into the internal network. - The OAuth token of the runtime access never goes to the target. The control headers
X-IFT-*are removed before the call, and the target’sSet-Cookiedoes not come back. - At the target, the relay preferably signs in with a user credential from the security material (header
X-IFT-Credential), so passwords do not have to come from the browser.
Relay header contract
Call: POST https://<runtime-host>/http/iflowtailor/relay with Authorization: Bearer <token>. The extension sets the headers itself.
| Header | Meaning |
|---|---|
X-IFT-Target-Url | Required: target address, for on-premise the virtual host from the Cloud Connector |
X-IFT-Method | Method towards the target, default GET |
X-IFT-Proxy-Type | OnPremise (default) or Internet |
X-IFT-Location-Id | Location ID of the Cloud Connector |
X-IFT-Credential | Name of a user credential; basic sign-in at the target |
X-IFT-Authorization | Passed on as Authorization if no credential is given |
The response contains the target’s body and status, plus X-IFT-Status and X-IFT-Duration (ms).
OData metadata via the relay
The OData metadata view from Pro uses the relay too: Load from URL › way Via the tenant (relay iFlow) fetches the $metadata of a service behind the Cloud Connector or with credentials that only exist in the security material. A dialog with target, credential and proxy type asks first, the call is recorded in the audit log, and the team policy can block it (odata.metadata.relay). The target must match ALLOWED_TARGETS.
- With the relay as above: sign-in at the target with basic (user credential by name) or without authentication.
- With relay version 2: also OAuth2 client credentials, client certificate (key alias from the keystore), OAuth2 SAML bearer assertion and principal propagation – each with the tenant’s security material by name, without iFlowTailor seeing a secret. For this, the headers
X-IFT-Auth-TypeandX-IFT-Key-Aliasare added, one branch with an HTTP receiver per authentication type, and the response carriesX-IFT-Relay-Version: 2. Without the new headers, version 2 behaves like today’s relay.
The extension is prepared for version 2: if an older relay answers, it reports “Needs relay version 2” instead of an unclear error. The extended relay iFlow has not yet been confirmed on a real tenant; until then, use the way Directly from the browser for these authentication types where possible.
Setting up the Groovy Runner
- Create the iFlow
IFT_GroovyRunnerin the packageiFlowTailor Helpers. - Sender: HTTPS with address
/iflowtailor/runner, user roleESBMessaging.send, CSRF protection off. - Content Modifier: property
TIMEOUT_SECONDSas an externalized parameter (default 10). - Script
runGroovy.groovy, then the end. Log level Info, then deploy. - Store the service key as above, then open the Groovy Runner view in the panel.
- Read the notes and click Understood – enable runner. Disable runner switches it off again.
How to work with the runner is described in Testing › Groovy Runner.
Runner security
Before you enable it, the extension says clearly what you are agreeing to: “The runner sends your script and the sample payload to a helper iFlow … and runs it there on the real CPI runtime – with all permissions of that iFlow.”, “Use test payloads only, no real personal data.” and “The script can access tenant services (credentials, data stores …) – only run your own, reviewed scripts.”
- The script runs in its own GroovyShell with
SecureASTCustomizer: System, Runtime, ProcessBuilder, Thread, ClassLoader, Class and file access via File, Files and Paths are blocked. - A time limit (
TIMEOUT_SECONDS) stops long runs. - The script gets a copy of the message, never the real one. Log output goes into the response, not into the message processing log; the request headers are removed after the run.
If you deployed the runner before the variable inspector existed, update runGroovy.groovy and deploy again – otherwise the script reports No such property: __ift.
See also
- Features at a glance Features · Develop
- Further reading Cloud Connector for SAP (SAP PRESS)
- Further reading SAP Cloud Integration Cookbook – Advanced Cloud Integration with SAP Integration Suite (SAP PRESS)
- Docs Test
- Docs OData metadata
- Docs Permissions and privacy
- Sources integration-content/runner1 · integration-content/relay2