Quality Control and Error Handling Using the Manual PD Checker Workflow

The Manual PD Checker workflow automates the quality control process by retrieving order details from Monday.com using a pulse ID. It evaluates whether a measurement service is attached to an order and routes the data through specific sub-zaps to update Property Data (PD) scores and check for secondary orders.

Required Sub-Zap

This workflow relies on the PD Sub-Zap to process the data. Ensure the Sub-Zap is active and configured to accept inputs like Zip, Unit, Address, and Order ID.

Workflow Architecture

The workflow uses a branching logic based on the presence of a measurement service.

flowchart TD
    A["Webhook Trigger (Pulse ID)"] --> B["Get Monday.com Column Values"]
    B --> C{"Has Measurement Service?"}
    
    C -- "Yes" --> D["Path A: Call PD Checker Sub-Zap"]
    D --> F["Update PD Score & 2nd Order"]
    
    C -- "No" --> E["Path B: Check for 2nd Orders Only"]
    E --> G["Update 2nd Order Status"]
    
    F --> H["1-Minute Delay"]
    G --> H
    
    H --> I["Python Cleanup Script (Reset Button)"]

How the workflow operates

When triggered, the Zap performs the following sequential actions to process the order and update your Monday.com board.

  1. 1

    Catch the Webhook

    The workflow begins when it receives a webhook containing the pulseId of the Monday.com item.

  2. 2

    Retrieve Order Details

    Using the pulseId, the Zap queries the 🏠 Orders board to retrieve all relevant column values, including the Address, Site ID, Order ID, Client Name, and Measurement status.

  3. 3

    Evaluate Branching Logic

    The workflow checks the "Measurement" column and routes the item down one of two paths (see the comparison table below).

  4. 4

    Execute Sub-Zap

    Depending on the path, the workflow passes the collected data to a Sub-Zap to calculate the PD Score or check for secondary orders.

  5. 5

    Update Monday.com

    The results from the Sub-Zap are written back to the Monday.com board. The action column is temporarily marked as Done 🟢.

  6. 6

    Reset the Trigger Button

    After a 1-minute delay, a custom Python script runs to clear the action column, resetting the manual trigger button so it can be used again if needed.

Branching Paths

The workflow branches based on whether the order includes a measurement service.

FeaturePath A: Has Measurement ServicePath B: No Measurement Service
ConditionMeasurement = "Yes"Measurement = "No"
Sub-Zap ActionCalls full PD Checker Sub-ZapChecks for 2nd Orders only
Data PassedIncludes Current PDExcludes Current PD
Monday.com UpdatesUpdates PD Score & 2nd Order statusUpdates 2nd Order status only

Both paths pass standard location and client data (Zip, Unit, Address, Site ID, Order ID, Client Name, and 2nd Order Search String) to the Sub-Zap.

Automated UI Cleanup

To provide a seamless experience in Monday.com, the workflow automatically resets the manual trigger button after processing.

After a 1-minute delay, the workflow executes a Python script. The script includes an intentional 8-second buffer to guarantee that the Sub-Zap has completely finished posting the PD Score and 2nd Order data to the board before the UI is cleared.

import requests
import json
import time

# --- 1. CONFIGURATION ---
api_key = input_data.get('api_key')
item_id = input_data.get('item_id')
board_id = 7932413985 
action_col = "color_mm19bvt6" 

headers = {
    "Authorization": api_key,
    "Content-Type": "application/json",
    "API-Version": "2023-10"
}

# --- 2. THE 8-SECOND PAUSE ---
# We wait here to ensure the Sub-Zap's "Update Item" has finished 
time.sleep(8)

# --- 3. PASS 1: Set to "Done 🟢" ---
done_val = json.dumps({"label": "Done 🟢"})
query_done = f'mutation {{ change_column_value(item_id: "{item_id}", board_id: {board_id}, column_id: "{action_col}", value: {json.dumps(done_val)}) {{ id }} }}'
requests.post("https://api.monday.com/v2", json={'query': query_done}, headers=headers)

# --- 4. SHORT BUFFER ---
time.sleep(2)

# --- 5. PASS 2: Clear the Status ---
clear_val = json.dumps({"label": None})
query_clear = f'mutation {{ change_column_value(item_id: "{item_id}", board_id: {board_id}, column_id: "{action_col}", value: {json.dumps(clear_val)}) {{ id }} }}'
requests.post("https://api.monday.com/v2", json={'query': query_clear}, headers=headers)

Do not remove the time.sleep(8) command from the script. Removing this buffer may cause the status to clear before the Sub-Zap finishes writing data, leading to incomplete board updates.

Frequently Asked Questions

Why is there a 1-minute delay before the cleanup script runs?

The 1-minute delay ensures that all Monday.com API rate limits are respected and gives the external Sub-Zap ample time to process the data and return the payload before the workflow attempts to modify the board again.

What happens if an order is missing the Measurement status?

If the "Measurement" column is blank or contains a value other than "Yes" or "No", the workflow will halt at the branching step, as neither Path A nor Path B criteria will be met. Ensure all orders have this field populated before triggering the checker.