# keboola/component-meta architecture

> Architecture diagram of the GitHub repository keboola/component-meta, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-24). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/keboola/component-meta
- Repository: https://github.com/keboola/component-meta

## Overview

This is a Keboola extractor for Facebook Graph API data, covering Facebook Pages, Facebook Ads, and Instagram. A configured job validates account and query settings, then the component delegates extraction to the Facebook client, which handles account tokens and dispatches requests. Nested queries support Graph API edges and Insights DSL metrics; Facebook Ads async Insights use report submission and polling. Responses are normalized into table rows and written to Keboola output tables. The README documents broader endpoint coverage than the sampled excerpts; the graph includes those capabilities at the client boundary without inferring their internal wiring.

Main entry points: [`src/component.py`](https://github.com/keboola/component-meta/blob/main/src/component.py) (Component), [`src/client.py`](https://github.com/keboola/component-meta/blob/main/src/client.py) (Facebook client), [`src/page_loader.py`](https://github.com/keboola/component-meta/blob/main/src/page_loader.py) (Page loader), [`src/output_parser.py`](https://github.com/keboola/component-meta/blob/main/src/output_parser.py) (Output parser)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_job["Job orchestration"]
  node_component["Component<br/>[component.py]"]
  node_config["Configuration models<br/>[configuration.py]"]
end

subgraph group_extract["Extraction"]
  node_client["Facebook client<br/>[client.py]"]
  node_account_actions["Account actions<br/>[component.py]"]
  node_page_loader["Page loader<br/>[page_loader.py]"]
  node_nested_queries["Nested queries<br/>[client.py]"]
  node_insights_dsl["Insights DSL<br/>[page_loader.py]"]
  node_async_insights["Async Ads Insights<br/>[client.py]"]
  node_pagination["Pagination handling<br/>[page_loader.py]"]
end

subgraph group_transform["Response processing"]
  node_output_parser["Output parser<br/>[output_parser.py]"]
end

subgraph group_output["Table output"]
  node_tables[("Keboola output tables")]
end

node_operator(("Keboola job"))
node_graph_api{{"Facebook Graph API"}}

node_operator -->|"starts job"| node_component
node_component -->|"validates settings"| node_config
node_component -->|"processes queries"| node_client
node_component -->|"dispatches actions"| node_account_actions
node_account_actions -->|"lists accounts"| node_client
node_client -->|"dispatches queries"| node_nested_queries
node_client -->|"dispatches reports"| node_async_insights
node_nested_queries -->|"loads Graph data"| node_page_loader
node_nested_queries -->|"builds metric requests"| node_insights_dsl
node_async_insights -->|"starts and polls"| node_page_loader
node_page_loader -->|"requests data"| node_graph_api
node_page_loader -->|"handles page links"| node_pagination
node_client -->|"parses responses"| node_output_parser
node_output_parser -->|"loads next page"| node_page_loader
node_component -->|"writes table rows"| node_tables

click node_component "https://github.com/keboola/component-meta/blob/main/src/component.py"
click node_config "https://github.com/keboola/component-meta/blob/main/src/configuration.py"
click node_client "https://github.com/keboola/component-meta/blob/main/src/client.py"
click node_account_actions "https://github.com/keboola/component-meta/blob/main/src/component.py"
click node_page_loader "https://github.com/keboola/component-meta/blob/main/src/page_loader.py"
click node_nested_queries "https://github.com/keboola/component-meta/blob/main/src/client.py"
click node_insights_dsl "https://github.com/keboola/component-meta/blob/main/src/page_loader.py"
click node_async_insights "https://github.com/keboola/component-meta/blob/main/src/client.py"
click node_pagination "https://github.com/keboola/component-meta/blob/main/src/page_loader.py"
click node_output_parser "https://github.com/keboola/component-meta/blob/main/src/output_parser.py"

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_component,node_config toneBlue
class node_client,node_account_actions,node_page_loader,node_nested_queries,node_insights_dsl,node_async_insights,node_pagination toneAmber
class node_output_parser,node_graph_api toneMint
class node_tables toneRose
class node_operator toneIndigo
```

## Components

### Job orchestration

- [Component](https://github.com/keboola/component-meta/blob/main/src/component.py): `src/component.py`
- [Configuration models](https://github.com/keboola/component-meta/blob/main/src/configuration.py): `src/configuration.py`

### Extraction

- [Facebook client](https://github.com/keboola/component-meta/blob/main/src/client.py): `src/client.py`
- [Account actions](https://github.com/keboola/component-meta/blob/main/src/component.py): `src/component.py`
- [Page loader](https://github.com/keboola/component-meta/blob/main/src/page_loader.py): `src/page_loader.py`
- [Nested queries](https://github.com/keboola/component-meta/blob/main/src/client.py): `src/client.py`
- [Insights DSL](https://github.com/keboola/component-meta/blob/main/src/page_loader.py): `src/page_loader.py`
- [Async Ads Insights](https://github.com/keboola/component-meta/blob/main/src/client.py): `src/client.py`
- [Pagination handling](https://github.com/keboola/component-meta/blob/main/src/page_loader.py): `src/page_loader.py`

### Response processing

- [Output parser](https://github.com/keboola/component-meta/blob/main/src/output_parser.py): `src/output_parser.py`

### Table output

- **Keboola output tables**

### Other components

- **Keboola job**
- **Facebook Graph API**

## Connections

- Keboola job → Component: starts job
- Component → Configuration models: validates settings
- Component → Facebook client: processes queries
- Component → Account actions: dispatches actions
- Account actions → Facebook client: lists accounts
- Facebook client → Nested queries: dispatches queries
- Facebook client → Async Ads Insights: dispatches reports
- Nested queries → Page loader: loads Graph data
- Nested queries → Insights DSL: builds metric requests
- Async Ads Insights → Page loader: starts and polls
- Page loader → Facebook Graph API: requests data
- Page loader → Pagination handling: handles page links
- Facebook client → Output parser: parses responses
- Output parser → Page loader: loads next page
- Component → Keboola output tables: writes table rows
