HUB
Sign inSign up
application-engine logo

netgrif/application-engine

By netgrif

•Updated 6 days ago

Petriflow workflow engine. Runs process-driven apps as a REST service.

Image
Languages & frameworks
Developer tools
Content management system
1

8.3K

netgrif/application-engine repository overview

⁠Netgrif Application Engine

Open-source workflow engine that runs Petriflow⁠ process models on the JVM. The image is a ready-to-run Spring Boot 3.5 service (Java 21 JRE) exposing a REST API, so you only supply the data services it talks to: MongoDB, Elasticsearch and Redis.

  • Process interpreter for the Petriflow language (Petri-net-based workflows)
  • Server-side Groovy actions, process events, role-based access control
  • MongoDB document store, Elasticsearch full-text search, Redis sessions, MinIO/S3 object storage
  • Basic and JWT authentication, LDAP/AD, SMTP mail, PDF and QR generation, Quartz scheduler
  • Runs as non-root user 10001:10001 on port 8080

⁠Requirements

ServiceVersionPurposePort
MongoDB8+, configured as a replica setPrimary document store27017
Elasticsearch8+Full-text search and filtering9200 / 9300
Redis8+Session store and caching6379
MinIOoptionalFile and object storage9000

MongoDB must run as a replica set (a single-node rs0 is enough) because the engine uses transactions.

⁠Quick start

Start the required services first. This compose file starts MongoDB with an rs0 replica set, Elasticsearch, Redis and the engine:

services:
  mongodb:
    image: mongo:8.0
    command: [ "--replSet", "rs0", "--bind_ip_all" ]
    healthcheck:
      test: [ "CMD-SHELL", "mongosh --quiet --eval \"try { rs.status() } catch (e) { rs.initiate({_id:'rs0',members:[{_id:0,host:'127.0.0.1:27017'}]}) }\"" ]
      interval: 10s
      timeout: 30s
      retries: 20
    volumes:
      - mongo_data:/data/db

  elasticsearch:
    image: elasticsearch:8.19.15
    environment:
      discovery.type: single-node
      xpack.security.enabled: "false"
      ES_JAVA_OPTS: -Xms512m -Xmx512m
    volumes:
      - es_data:/usr/share/elasticsearch/data

  redis:
    image: redis:8

  engine:
    image: netgrif/application-engine:latest
    ports:
      - "8080:8080"
    environment:
      NETGRIF_ENGINE_DATA_MONGODB_URI: mongodb://mongodb:27017
      NETGRIF_ENGINE_DATA_ELASTIC_URL: elasticsearch
      NETGRIF_ENGINE_DATA_REDIS_HOST: redis
      NETGRIF_ENGINE_SECURITY_AUTH_ADMIN_PASSWORD: change-me
      NETGRIF_ENGINE_SECURITY_ENCRYPTION_PASSWORD: change-me-too
    volumes:
      - nae_storage:/opt/netgrif/engine/storage
      - nae_log:/opt/netgrif/engine/log
    depends_on:
      mongodb:
        condition: service_healthy
      elasticsearch:
        condition: service_started
      redis:
        condition: service_started

volumes:
  mongo_data:
  es_data:
  nae_storage:
  nae_log:
docker compose up -d

The engine listens on http://localhost:8080⁠ and reports health at http://localhost:8080/manage/health⁠.

On first start the image creates a super user:

  • Username: admin
  • Email: [email protected]
  • Password: the value of NETGRIF_ENGINE_SECURITY_AUTH_ADMIN_PASSWORD; if you don't set it, a random password is generated and printed in the startup log.

To reuse an existing MongoDB, Elasticsearch or Redis instead, run the engine alone:

docker run -d --name nae -p 8080:8080 \
  -e NETGRIF_ENGINE_DATA_MONGODB_URI=mongodb://host.docker.internal:27017 \
  -e NETGRIF_ENGINE_DATA_ELASTIC_URL=host.docker.internal \
  -e NETGRIF_ENGINE_DATA_REDIS_HOST=host.docker.internal \
  -e NETGRIF_ENGINE_SECURITY_AUTH_ADMIN_PASSWORD=change-me \
  netgrif/application-engine:latest

⁠Configuration

All settings are Spring properties and can be passed as environment variables:

PropertyEnvironment variableDefault
netgrif.engine.data.mongodb.uriNETGRIF_ENGINE_DATA_MONGODB_URImongodb://localhost:27017
netgrif.engine.data.database-nameNETGRIF_ENGINE_DATA_DATABASE_NAMEnae
netgrif.engine.data.elasticsearch.urlNETGRIF_ENGINE_DATA_ELASTIC_URLlocalhost
netgrif.engine.data.elasticsearch.searchPortNETGRIF_ENGINE_DATA_ELASTIC_SEARCH_PORT9200
netgrif.engine.data.redis.hostNETGRIF_ENGINE_DATA_REDIS_HOSTlocalhost
netgrif.engine.data.redis.portNETGRIF_ENGINE_DATA_REDIS_PORT6379
netgrif.engine.storage.default-typeNETGRIF_ENGINE_STORAGE_DEFAULT_TYPElocal
netgrif.engine.security.auth.admin-passwordNETGRIF_ENGINE_SECURITY_AUTH_ADMIN_PASSWORD(random, logged once)
netgrif.engine.security.auth.open-registrationNETGRIF_ENGINE_SECURITY_AUTH_OPEN_REGISTRATIONtrue
netgrif.engine.mail.hostNETGRIF_ENGINE_MAIL_HOST(empty, mail disabled)
netgrif.engine.server.port—8080

JVM options go through JAVA_TOOL_OPTIONS. The full reference is at https://platform.netgrif.cloud/refs/config/engine-standalone-config⁠.

⁠Runtime details

ItemValue
HTTP port8080
Management endpoints/manage (health, metrics, prometheus, loggers)
REST API/api
User10001:10001, non-root
Writable paths/opt/netgrif/engine/storage, /opt/netgrif/engine/log, /opt/netgrif/engine/modules
Process models/opt/netgrif/engine/src/main/resources/petriNets and through the REST API
Stop signalSIGTERM

A named Docker volume inherits the ownership of the image directory and works without extra setup. For bind mounts, set the owner to 10001:10001.

OpenAPI documentation is disabled by default. Set NETGRIF_ENGINE_SWAGGER_ENABLED=true to publish /v3/api-docs and /swagger-ui.html.

⁠Security notes

  • Set NETGRIF_ENGINE_SECURITY_AUTH_ADMIN_PASSWORD and NETGRIF_ENGINE_SECURITY_ENCRYPTION_PASSWORD before the first start. The encryption password protects stored values, so changing it later invalidates existing data.
  • Replace the bundled JWT keypair (private.der, public.crt under src/main/resources/certificates) with your own before exposing the engine to a network, or set NETGRIF_ENGINE_SECURITY_JWT_PRIVATE_KEY.
  • Set NETGRIF_ENGINE_SECURITY_AUTH_OPEN_REGISTRATION=false if users must not register themselves.

⁠License

NETGRIF Community License 2.0: free for development, testing, evaluation, education, and other non-production use. Production use requires a commercial license from NETGRIF, s.r.o. See netgrif.com/license⁠.

Tag summary
Recent tags
Content type
Image
Digest
sha256:fce026fad…
Size
252.8 MB
Last updated
6 days ago
docker pull netgrif/application-engine:latest