{
  "name": "Latvia company financials lookup — CEE Data",
  "nodes": [
    {
      "parameters": {},
      "id": "manual-trigger",
      "name": "Check a company",
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [-700, 80]
    },
    {
      "parameters": {
        "values": {
          "string": [{ "name": "companyCode", "value": "40103504912" }],
          "number": [{ "name": "historyYears", "value": 3 }]
        },
        "options": {}
      },
      "id": "company-input",
      "name": "Latvian registry code",
      "type": "n8n-nodes-base.set",
      "typeVersion": 1,
      "position": [-470, 80]
    },
    {
      "parameters": {
        "requestMethod": "POST",
        "url": "https://api.apify.com/v2/acts/cee-data~latvia-company-financials-scraper/run-sync-get-dataset-items",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [{ "name": "Authorization", "value": "Bearer {{$credentials.httpHeaderAuth.value}}" }]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{JSON.stringify({companyCodes:[$json.companyCode],historyYears:$json.historyYears,maxItems:$json.historyYears,maxRequestRetries:2,requestTimeoutSecs:30,cacheMaxAgeHours:24,forceRefresh:false})}}",
        "options": { "timeout": 300000 }
      },
      "credentials": { "httpHeaderAuth": { "id": "", "name": "Apify API token" } },
      "id": "latvia-financials",
      "name": "Get official annual reports",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [-190, 80]
    },
    {
      "parameters": {
        "jsCode": "return items.map((item) => {\n  const report = item.json;\n  return { json: {\n    companyCode: report.companyCode ?? null,\n    reportYear: report.reportYear ?? null,\n    periodEnd: report.periodEnd ?? null,\n    currency: report.currency ?? null,\n    roundedToNearest: report.roundedToNearest ?? null,\n    netTurnover: report.netTurnover ?? null,\n    assets: report.assets ?? null,\n    equity: report.equity ?? null,\n    currentLiabilities: report.currentLiabilities ?? null,\n    netProfit: report.netProfit ?? null,\n    netProfitMargin: report.netProfitMargin ?? null,\n    equityRatio: report.equityRatio ?? null,\n    currentRatio: report.currentRatio ?? null,\n    employees: report.employees ?? null,\n    sourceUpdatedAt: report.sourceUpdatedAt ?? null,\n    dataStatus: report.statementId ? 'financial-data' : 'metadata-only'\n  } };\n});"
      },
      "id": "financial-output",
      "name": "Normalized financial output",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [100, 80]
    },
    {
      "parameters": {
        "content": "## Setup\n1. Create **Header Auth** credentials named **Apify API token** and put only your Apify token in the value.\n2. Select them in **Get official annual reports**.\n3. Replace the example Latvian 11-digit registry code and execute.\n\nThe workflow returns one item per company-year, newest first. Connect Google Sheets, Airtable, a database or an alert after **Normalized financial output**.\n\nActor: https://apify.com/cee-data/latvia-company-financials-scraper\nPrice: $0.005 per company-year with financial data; unknown companies are free.",
        "height": 340,
        "width": 520
      },
      "id": "setup-note",
      "name": "Read me — setup",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [-730, -330]
    }
  ],
  "connections": {
    "Check a company": { "main": [[{ "node": "Latvian registry code", "type": "main", "index": 0 }]] },
    "Latvian registry code": { "main": [[{ "node": "Get official annual reports", "type": "main", "index": 0 }]] },
    "Get official annual reports": { "main": [[{ "node": "Normalized financial output", "type": "main", "index": 0 }]] }
  },
  "active": false,
  "settings": { "executionOrder": "v1" },
  "tags": ["Apify", "Latvia", "Finance", "Company data", "Due diligence"]
}