2.7 KiB
Configure a Connector Proxy
Setting the Environment Variable
Once a Connector Proxy
has been deployed, to integrate it with SpiffArena we simply need to update an environment variable and restart the backend. If using the Getting Started Guide open the docker-compose.yml file, else edit the environment variable in the way appropriate for your deployment. The variable we need to change is called SPIFFWORKFLOW_BACKEND_CONNECTOR_PROXY_URL
.
Example diff using the function URL from the AWS tutorial:
diff --git a/docker-compose.yml b/docker-compose.yml
index 95b87b39..7d55c492 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -26,7 +26,7 @@ services:
SPIFFWORKFLOW_BACKEND_URL: "http://localhost:${SPIFF_BACKEND_PORT:-8000}"
SPIFFWORKFLOW_BACKEND_BPMN_SPEC_ABSOLUTE_DIR: "/app/process_models"
- SPIFFWORKFLOW_BACKEND_CONNECTOR_PROXY_URL: "http://spiffworkflow-connector:8004"
+ SPIFFWORKFLOW_BACKEND_CONNECTOR_PROXY_URL: "https://crbxgaopinfxqscntkqixjbl4e0gigpm.lambda-url.us-east-1.on.aws"
SPIFFWORKFLOW_BACKEND_DATABASE_URI: "mysql+mysqlconnector://root:${SPIFF_MYSQL_PASS:-my-secret-pw}@spiffworkflow-db:${SPIFF_MYSQL_PORT:-8003}/spiffworkflow_backend_development"
SPIFFWORKFLOW_BACKEND_LOAD_FIXTURE_DATA: "false"
SPIFFWORKFLOW_BACKEND_OPEN_ID_CLIENT_ID: "spiffworkflow-backend"
Restart:
docker compose down
docker compose up -d
Testing
Create a new process model as described in the Getting Started Guide. Add a Service Task
and in its properties panel you will see a drop down to pick which connector in your Connector Proxy
to call. In this demo we deployed http get and post connectors:
Choose the http/GetRequest
operator ID and enter the dog fact api URL. Remember to quote it since parameters are evaluated as Python expressions.
Run the process and once complete you can see the response in the workflow:
You have successfully configured a Connector Proxy
for use with SpiffArena
. You made a call from a workflow to get a dog fact. Now imagine that call was to talk to an external system relevant to your business processes.