# project-flogo/core architecture

> Architecture diagram of the GitHub repository project-flogo/core, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-22). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/project-flogo/core
- Repository: https://github.com/project-flogo/core

## Overview

Flogo Core is a library for creating and extending serverless and edge-microservice applications. The principal workflow is to define an application through the API, construct an engine, start the app and its triggers, then handle events by mapping trigger data and dispatching actions. The repository also provides data mapping and expression capabilities, contribution interfaces, resources, and runtime support. Edges are limited to relationships shown in the excerpts, SOURCE INDEX references, or README; unsampled implementations are represented by their known directories where appropriate.

Main entry points: [`trigger/handler.go`](https://github.com/project-flogo/core/blob/master/trigger/handler.go) (Event handler), [`api/api.go`](https://github.com/project-flogo/core/blob/master/api/api.go) (Programmatic API), [`app/app.go`](https://github.com/project-flogo/core/blob/master/app/app.go) (Application model), [`engine/engineimpl.go`](https://github.com/project-flogo/core/blob/master/engine/engineimpl.go) (Engine lifecycle)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_creation["App creation"]
  node_program_api["Programmatic API<br/>[api.go]"]
  node_app_model["Application model<br/>[app.go]"]
end

subgraph group_runtime["Runtime execution"]
  node_engine["Engine lifecycle<br/>[engineimpl.go]"]
  node_action_runner["Action runner"]
  node_triggers["Trigger lifecycle<br/>[app.go]"]
  node_event_handler["Event handler<br/>[handler.go]"]
  node_sequence_handler["Sequence handler"]
  node_app_events["App events"]
end

subgraph group_data["Data processing"]
  node_mapper["Object mapper<br/>[object.go]"]
  node_expressions["Expressions"]
  node_data_model["Data model"]
  node_properties[("App properties<br/>[manager.go]")]
end

subgraph group_extensions["Contributions and resources"]
  node_actions["Actions<br/>[action.go]"]
  node_activities["Activities<br/>[activity.go]"]
  node_resources["Resources<br/>[manager.go]"]
  node_connections["Connection managers<br/>[manager.go]"]
end

node_developer(("Application developer"))

node_developer -.->|"defines app"| node_program_api
node_program_api -->|"creates engine"| node_engine
node_engine -->|"constructs app"| node_app_model
node_engine -->|"selects runner"| node_action_runner
node_app_model -->|"creates and starts"| node_triggers
node_app_model -->|"loads resources"| node_resources
node_app_model -->|"starts managers"| node_connections
node_triggers -.->|"dispatches events"| node_event_handler
node_event_handler -->|"maps action data"| node_mapper
node_event_handler -->|"evaluates conditions"| node_expressions
node_event_handler -->|"runs action"| node_action_runner
node_event_handler -->|"dispatches action"| node_actions
node_sequence_handler -->|"maps action data"| node_mapper
node_sequence_handler -->|"runs action"| node_action_runner
node_mapper -->|"builds mapping expressions"| node_expressions
node_mapper -->|"evaluates against scope"| node_data_model
node_event_handler -->|"reads property snapshot"| node_properties
node_engine -.->|"posts lifecycle events"| node_app_events
node_program_api -.->|"supports contributions"| node_actions
node_program_api -.->|"supports contributions"| node_activities

click node_program_api "https://github.com/project-flogo/core/blob/master/api/api.go"
click node_app_model "https://github.com/project-flogo/core/blob/master/app/app.go"
click node_engine "https://github.com/project-flogo/core/blob/master/engine/engineimpl.go"
click node_action_runner "https://github.com/project-flogo/core/tree/master/engine/runner"
click node_triggers "https://github.com/project-flogo/core/blob/master/app/app.go"
click node_event_handler "https://github.com/project-flogo/core/blob/master/trigger/handler.go"
click node_sequence_handler "https://github.com/project-flogo/core/blob/master/trigger/sequenceKeyHandler.go"
click node_actions "https://github.com/project-flogo/core/blob/master/action/action.go"
click node_activities "https://github.com/project-flogo/core/blob/master/activity/activity.go"
click node_resources "https://github.com/project-flogo/core/blob/master/app/resource/manager.go"
click node_mapper "https://github.com/project-flogo/core/blob/master/data/mapper/object.go"
click node_expressions "https://github.com/project-flogo/core/tree/master/data/expression"
click node_data_model "https://github.com/project-flogo/core/tree/master/data"
click node_properties "https://github.com/project-flogo/core/blob/master/data/property/manager.go"
click node_app_events "https://github.com/project-flogo/core/tree/master/engine/event"
click node_connections "https://github.com/project-flogo/core/blob/master/support/connection/manager.go"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_program_api,node_app_model toneBlue
class node_engine,node_action_runner,node_triggers,node_event_handler,node_sequence_handler,node_app_events toneAmber
class node_mapper,node_expressions,node_data_model,node_properties toneMint
class node_actions,node_activities,node_resources,node_connections toneRose
class node_developer toneIndigo
```

## Components

### App creation

- [Programmatic API](https://github.com/project-flogo/core/blob/master/api/api.go): `api/api.go`
- [Application model](https://github.com/project-flogo/core/blob/master/app/app.go): `app/app.go`

### Runtime execution

- [Engine lifecycle](https://github.com/project-flogo/core/blob/master/engine/engineimpl.go): `engine/engineimpl.go`
- [Action runner](https://github.com/project-flogo/core/tree/master/engine/runner): `engine/runner`
- [Trigger lifecycle](https://github.com/project-flogo/core/blob/master/app/app.go): `app/app.go`
- [Event handler](https://github.com/project-flogo/core/blob/master/trigger/handler.go): `trigger/handler.go`
- [Sequence handler](https://github.com/project-flogo/core/blob/master/trigger/sequenceKeyHandler.go): `trigger/sequenceKeyHandler.go`
- [App events](https://github.com/project-flogo/core/tree/master/engine/event): `engine/event`

### Data processing

- [Object mapper](https://github.com/project-flogo/core/blob/master/data/mapper/object.go): `data/mapper/object.go`
- [Expressions](https://github.com/project-flogo/core/tree/master/data/expression): `data/expression`
- [Data model](https://github.com/project-flogo/core/tree/master/data): `data`
- [App properties](https://github.com/project-flogo/core/blob/master/data/property/manager.go): `data/property/manager.go`

### Contributions and resources

- [Actions](https://github.com/project-flogo/core/blob/master/action/action.go): `action/action.go`
- [Activities](https://github.com/project-flogo/core/blob/master/activity/activity.go): `activity/activity.go`
- [Resources](https://github.com/project-flogo/core/blob/master/app/resource/manager.go): `app/resource/manager.go`
- [Connection managers](https://github.com/project-flogo/core/blob/master/support/connection/manager.go): `support/connection/manager.go`

### Other components

- **Application developer**

## Connections

- Application developer → Programmatic API: defines app
- Programmatic API → Engine lifecycle: creates engine (evidence: `api/api.go`)
- Engine lifecycle → Application model: constructs app (evidence: `engine/engineimpl.go`)
- Engine lifecycle → Action runner: selects runner (evidence: `engine/engineimpl.go`)
- Application model → Trigger lifecycle: creates and starts (evidence: `app/app.go`)
- Application model → Resources: loads resources (evidence: `app/app.go`)
- Application model → Connection managers: starts managers (evidence: `app/app.go`)
- Trigger lifecycle → Event handler: dispatches events
- Event handler → Object mapper: maps action data (evidence: `trigger/handler.go`)
- Event handler → Expressions: evaluates conditions (evidence: `trigger/handler.go`)
- Event handler → Action runner: runs action (evidence: `trigger/handler.go`)
- Event handler → Actions: dispatches action (evidence: `trigger/handler.go`)
- Sequence handler → Object mapper: maps action data (evidence: `trigger/sequenceKeyHandler.go`)
- Sequence handler → Action runner: runs action (evidence: `trigger/sequenceKeyHandler.go`)
- Object mapper → Expressions: builds mapping expressions (evidence: `data/mapper/object.go`)
- Object mapper → Data model: evaluates against scope (evidence: `data/mapper/object.go`)
- Event handler → App properties: reads property snapshot (evidence: `trigger/handler.go`)
- Engine lifecycle → App events: posts lifecycle events
- Programmatic API → Actions: supports contributions
- Programmatic API → Activities: supports contributions
