Skip to content

n8n: scheduled company credit score monitoring workflow #33

Description

@francescobianco

Idea

Build an n8n workflow that runs daily, fetches the credit score of a watchlist of companies from Openapi, and sends a Slack alert if any score drops below a threshold.

Pseudocode for the PHP side

use Openapi\Client;

$client = new Client($token);
$watchlist = ['IT01234567890', 'IT09876543210'];

foreach ($watchlist as $vatNumber) {
    $score = json_decode(
        $client->get('https://risk.openapi.com/IT-creditscore', ['cf' => $vatNumber]),
        true
    );

    if ($score['value'] < 40) {
        // trigger Slack webhook from n8n
        yield ['cf' => $vatNumber, 'score' => $score['value'], 'alert' => true];
    }
}

n8n workflow sketch

Cron (daily 8am) → HTTP Request (PHP proxy) → IF score < 40 → Slack message

Open questions

  • Is there a way to subscribe to score changes via webhook instead of polling?
  • What is the recommended polling interval to avoid burning API credits?
  • Would an official n8n workflow template JSON be something the project could ship in examples/n8n/?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueGood for newcomersquestionFurther information is requested

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions