# Deploy BPMNs with multiple DFSP-IDs

* The Payment Hub EE business logic is always driven by the BPMN workflows included in the git repositories. It's not only possible but often necessary to customize these flows to meet the business requirements of a specific environment.&#x20;
* Deploying the workflows to the K8S cluster is a separate step, which can be done either manually for each business flow, or using a shell script like this (actual example from the project's CI server):
* In the below example tenants are picked up from the array declared and for N number of tenants the script will run for N number of times and Internal field separator will convert array into string and store in $t.&#x20;
* Zeebe command line tools (the `zbctl` binary) are also required for deploying the BPMN workflows if Zeebe Operations service is not deployed. This is part of the Zeebe releases and can be downloaded from the Zeebe release page at <https://github.com/zeebe-io/zeebe/releases>.
* BPMN deployment should be done with corresponding release version which can be obtained from release notes
* In the below script HOST should be replaced with the zeebe ops(port-forwarded) url from your cluster.

```sh
#!/bin/sh
HOST="https://zeebeops.sandbox.fynarfin.io/zeebe/upload"

deploy(){
    cmd="curl --insecure --location --request POST $HOST \
    --header 'Platform-TenantId: $2' \
    --form 'file=@\"$PWD/$1\"'"
    echo $cmd
    eval $cmd 
    # If curl response is not 200, it should fail the eval cmd
}

TENANTS="gorilla,lion,rhino"
IFS=',' read -ra TENANT_ARRAY <<< "$TENANTS"

for t in "${TENANT_ARRAY[@]}"; do
    LOC="orchestration/feel/*.bpmn"
    for f in $LOC; do
        # Check if "DFSPID" is present in the filename
        if echo "$f" | grep -q "DFSPID"; then
            # Replace "DFSPID" with the current tenant value in the filename
            new_file_name=$(echo "$f" | sed "s/DFSPID/$t/")
        else
            # If "DFSPID" is not present, use the original name
            new_file_name="$f"
        fi
        deploy "$new_file_name" "$t"
    done

    LOC2="orchestration/feel/example/*.bpmn"
    for f in $LOC2; do
        # Check if "DFSPID" is present in the filename
        if echo "$f" | grep -q "DFSPID"; then
            # Replace "DFSPID" with the current tenant value in the filename
            new_file_name=$(echo "$f" | sed "s/DFSPID/$t/")
        else
            # If "DFSPID" is not present, use the original name
            new_file_name="$f"
        fi
        deploy "$new_file_name" "$t"
    done
done
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://mifos.gitbook.io/docs/payment-hub-ee/overview/installation-instructions/configuration-instructions/deploy-bpmns-with-multiple-dfsp-ids.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
