spiff-arena/connector-proxy-demo
jbirddog 3d35ba7ee9
Add Python 3.12 support for connector proxy (#2104)
2024-10-09 16:18:15 -04:00
..
bin Editable dev container for connector proxy demo (#2097) 2024-10-03 12:28:20 -04:00
connector-example Editable dev container for connector proxy demo (#2097) 2024-10-03 12:28:20 -04:00
.gitignore Merge commit 'a2dd2bb2410b676a6a7cb004a059e62b2f418727' as 'connector-proxy-demo' 2022-11-18 13:27:01 -05:00
.tool-versions updated connector-http for new commands w/ burnettk 2024-02-14 11:52:31 -05:00
Dockerfile run poetry install after copying in the current directory for connector-example w/ burnettk (#2105) 2024-10-09 15:01:30 -04:00
LICENSE Merge commit 'a2dd2bb2410b676a6a7cb004a059e62b2f418727' as 'connector-proxy-demo' 2022-11-18 13:27:01 -05:00
README.md Merge commit '4f45f661e691b9e492ec22039ce964256f8792f8' into main 2023-02-14 16:53:28 -05:00
app.py Merge commit 'f7dada2c866f9ef7a8dc356868db1c2796967e4e' 2023-08-09 16:14:33 -04:00
dev.Dockerfile Add Python 3.12 support for connector proxy (#2104) 2024-10-09 16:18:15 -04:00
dev.docker-compose.yml Editable dev container for connector proxy demo (#2097) 2024-10-03 12:28:20 -04:00
poetry.lock Add Python 3.12 support for connector proxy (#2104) 2024-10-09 16:18:15 -04:00
pyproject.toml Add Python 3.12 support for connector proxy (#2104) 2024-10-09 16:18:15 -04:00

README.md

connector-proxy-demo

A Spiff-Connector for demonstration purposes - shows how to build connectors to some common 3rd party systems.

How to create a Connector Proxy for SpiffWorklow

Step 1. Create a python project with a few dependencies:

Create a bare-bones Flask application that depends on the core spiffworkflow-proxy (a flask blueprint) and any connector dependencies you wish to use. We will hopefully be adding a number of available connectors in the future. Please checkout the connector-aws repository for an example of how to create connections to new services.

  python = "^3.11"
  Flask = "^2.2.2"
  spiffworkflow-proxy = {git = "https://github.com/sartography/spiffworkflow-proxy"}
  connector-aws = { git = "https://github.com/sartography/connector-aws.git"}

Step 2.

Create a basic Flask Application that uses the SpiffWorkflow Proxy's Flask Blueprint

import os
from spiffworkflow_proxy.blueprint import proxy_blueprint
from flask import Flask

app = Flask(__name__)
app.config.from_pyfile("config.py", silent=True)
app.register_blueprint(proxy_blueprint)
if __name__ == "__main__":
    app.run(host="localhost", port=5000)

Step 3.

Fire it up.

#> flask run

Any dependencies you add will now be available for SpiffWorkflow to call using a Service Task. What's more, those services are now discoverable! So when someone drops a Service Task into their diagram, they will have a dropdown list of all the services you have made available to them. And those services will know what parameters are required, and can prompt diagram authors to provide information necessary to make the call. Which can be no parameters at all (Just give me a fact about Chuck Norris) ... to complex parameters (a json structure to be added to a DynamoDB Table).