Skip to main content

Contract margin guard

Every Monday this workflow compares the product discounts in your price sheets with the current cost price and creates an action for each price sheet that sells below a margin of 15%. So a rising cost price does not eat a customer agreement unnoticed.

In short
Where you use itIn the background. The results show in the Action Hub
StartsBy itself, every Monday at 06:00
Changes in PropellerCreates actions. It changes no price sheet
Uses AINo
TextsEnglish and Dutch
Runs in n8nAbout 4 a month
DifficultyMedium. You set the margin and who gets the actions

What you get​

One action per price sheet, lowest margin first. It names the products, their price for the customer and their cost price. The button opens the company, contact or customer the price sheet belongs to.

A thin margin action in the Action Hub: one line of a project price sheet sells at 14.3% margin, with the View company button

The workflow checks the discounts on a product. Discounts on a category or a price group are not checked.

What you need​

  • An n8n account with the credential Propeller API key. See Set up n8n.
  • An API key with Viewer access on Pricing and Product Data and Owner access on User management. Owner access on User management is what lets the workflow create actions.
  • Cost prices on your products. A product without a cost price is never flagged, so without cost prices the workflow finds nothing.

How it works​

The workflow reads every product discount of the types List price minus a percentage and Fixed amount that has not expired. For each one it asks Propeller what the customer of the price sheet pays at that quantity and what the product costs. The margin is the price minus the cost price, as a share of the price.

A price sheet that still has an open action from this workflow is skipped. When you complete the action and the margin is still below the floor, the price sheet gets a new action the next Monday.

Good to know

The workflows and agents in the Agent Hub are free to use and adapt. They are examples, not supported product features. Test them in a test environment and check the results before you use them on real customers.

Install it​

Install a workflow from the library explains each step.

  1. Import the file into n8n.
  2. Check that the seven nodes that talk to Propeller use the credential Propeller API key.
  3. Open the Settings node and set FLOOR to the lowest margin you accept.
  4. Set DEFAULT_ADMIN_USER_ID to the colleague who gets the actions. The number is in the Id column under Admin > Backoffice Users.
  5. Click Execute workflow to run it once.
  6. Click Publish.

After a run you find at most 15 new actions in the Action Hub. A test run is a real run and the actions are real. If nothing appears, no product discount is below the floor. It can also mean that your products have no cost price.

Make it yours​

SettingDefaultWhat it does
FLOOR15Discounts with a lower margin, as a percentage, are flagged
MAX_TICKETS_PER_RUN15The most price sheets flagged per run, lowest margin first
DEFAULT_ADMIN_USER_IDnullThe colleague who gets the actions. With null they go to nobody

To change the day or the time, open the node Schedule Weekly Mon 6am.

Limits​

  • A price sheet with several customers is checked for the first company, contact or customer on it.
  • A margin you accept on purpose keeps coming back. Lower FLOOR, or leave the action open.
  • A run reads at most 100,000 discounts. The actions say so when that limit is reached.