Quick overview
This workflow exposes a webhook that accepts a business process definition (inline or by URL) and orchestrates API calls to design a “digital twin” package, including a PostgreSQL schema, event-stream configuration, and an n8n sync-workflow JSON, then returns the assembled package in the HTTP response.
How it works
- Receives a POST request via a webhook containing either a
processUrl or an inline processDefinition plus configuration like twinName, processType, and eventBackend.
- Validates the payload and immediately returns an HTTP 400 response with error details if neither a URL nor an inline definition is provided.
- Calls an external HTTP endpoint to fetch the process definition when a URL is supplied.
- Calls an external HTTP endpoint for AI-driven digital-twin design to produce a state model, event taxonomy, and sync logic.
- Calls external HTTP endpoints to generate/validate PostgreSQL DDL, configure event-stream topics/consumers, and store the generated twin definition in a catalog.
- Assembles a final deliverable (documentation, PostgreSQL schema structure, event-stream config, and an n8n event-sync workflow JSON) and returns it to the caller with an HTTP 200 or 207 status.
Setup
- Replace the demo
httpbin.org URLs in the validation/config step with your real endpoints for process fetching, AI twin design, PostgreSQL schema generation, event-stream registration, and catalog storage.
- If you plan to execute the generated schema and run the generated sync workflow, prepare PostgreSQL credentials and an event-stream platform connection (for example Kafka/NATS/Redis Streams) in your environment.
- Copy the production webhook URL from n8n and configure your source system to POST the process payload to
/webhook/bp-digital-twin with either processUrl or processDefinition.