Bootstrap Amazon Ion into existing projects
Project description
machinery
State-aware workflow orchestrator.
This project aims to bring stateful workflows, by defining a list of actions representing multiple microservices.
Define a suite of actions to process events, abstract intelligence for your microservices.
Once defined, use your workflows to process your Events.
Example
We have 3 microservices:
- The
upper
microservice that transforms texts into uppercase - The
reverse
microservice that reverses a text - The
space-counter
microservice that returns the number of space in a string
Suppose we want to process some text by making it uppercase and reversing it.
We will define the following definitions:
examples/definitions/service-upper.json
examples/definitions/service-reverse.json
examples/definitions/service-space-counter.json
Then, we can define a Workflow in examples/definitions/workflow-process-text.json
.
After having created our Workflow, we can send our first Event !
We will send the content of examples/definitions/event-text.json
Goals
- Register services (ex: a new API)
- Define a simple Workflow (subsequent calls to different services)
- Allow async (expose endpoint for webhook?)
- Visualisation
Components
API (WIP)
Could be divided into Consumer API and Management API.
- Register services
- Define Workflows (json with arbitrary service definition)
- Treat Event
Data structures
Service
{
"name": "my-service-name",
"address": "http://my-service:5000/",
"spec": {
"inputs": {
"message": {
"type": "string",
"description": "The text to transform"
}
},
"outputs": {
"message": {
"type": "string",
"description": "The transformed text"
}
}
}
}
input:
name
: The name of the Serviceaddress
: The URL of the Servicespec
: The inputs/outputs of this Servicespec.inputs
: Each input with its type and descriptionspec.outputs
: Each output with its type and description
output: TBD (service-id, ack date)
Event
POST /e/<workflow-id>
{
"data": {
"message": "The Sun will rise in the morning !"
}
}
POSTing an Event will return an event-id
, an ack date and a status.
input:
data
: The Event's data that must match the Workflow's inputs.
Workflow
{
"name": "my-workflow",
"spec": {
"services": ["service-1", "service-2"],
"inputs": {
"message": {
"type": "string",
"description": "The text to process"
}
},
"outputs": {
"message": {
"type": "string",
"description": "The processed text"
}
},
"operations": { }
}
}
input:
name
: The name of the Workflowspec
: The spec of the Workflowspec.services
: The Services to be called, in orderspec.inputs
: The inputs of this Workflowspec.outputs
: The outputs of this workflow
output: TBD (workflow-id, ack date)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for workflow_machinery-0.0.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 69cd30c446d78f18f9f8b21157b47376451f8a422fb93802a56ae670e3c1a3e7 |
|
MD5 | 5f447e0a7ce3c70538c139bf51320183 |
|
BLAKE2b-256 | 9864a24edf98dbd18b97f56001ff411d928acccc215efadeb1bf48d5133b8d69 |