# Output Completion Check

Source: https://openflow.run/zh-tw/templates/output-completion-check/
Content language: en
Template revision: f2bf5895d91486412f320151dafd9c6b95b42091

開發

Check a completed-record batch for distinct nonempty IDs, invalid records, duplicates, and a configured minimum count.

[在 Open Flow 中使用](https://console.openflow.run/flows?importUrl=https%3A%2F%2Fraw.githubusercontent.com%2Foomol-lab%2Fawesome-workflow-templates%2Ff2bf5895d91486412f320151dafd9c6b95b42091%2Fworkflows%2Foutput-completion-check%2Ftemplates%2Foutput-completion-check.openflow.json)

*   [Open Flow JSON](https://raw.githubusercontent.com/oomol-lab/awesome-workflow-templates/f2bf5895d91486412f320151dafd9c6b95b42091/workflows/output-completion-check/templates/output-completion-check.openflow.json)
*   [n8n JSON](https://raw.githubusercontent.com/oomol-lab/awesome-workflow-templates/f2bf5895d91486412f320151dafd9c6b95b42091/workflows/output-completion-check/templates/output-completion-check.n8n.json)

![Output Completion Check 在 Open Flow 中的工作流程截圖](https://openflow.run/_astro/preview-light.W9Gvuhvk_ZzjD3V.webp)

Check whether a completed-record batch contains enough distinct nonempty IDs. The report counts invalid IDs and duplicates, including when no records were produced.

## Setup

In Open Flow, import the JSON and configure `minimumItems` and `recordIdField` on **Check completed outputs**. The defaults are `1` and `recordId`. Start it with a `records` array, for example:

```json
{
  "records": [
    { "recordId": "ORDER-001" },
    { "recordId": "ORDER-001" },
    { "recordId": "ORDER-002" }
  ]
}
```

In n8n, set the same values on **Configure check** and replace the fictional example records on **Completed records**. To use the check after real processing, connect your completed-output node to **Check completed outputs** and keep **Configure check** upstream. Enable **Always Output Data** on the producer so an empty result reaches the check. The included producer already enables this setting.

No accounts or network requests are required. This adaptation includes the source’s independent local validation component. The optional Keptick receipt integration is outside this template.

## Report

| Field | Meaning |
| --- | --- |
| `checkPassed` | Distinct IDs meet the minimum and no nonempty row has an invalid ID. |
| `checkStatus` | `healthy`, `below_minimum`, or `invalid_output`. Invalid IDs take precedence over the minimum check. |
| `items` | Number of distinct valid IDs. |
| `minimumItems` | Configured minimum, an integer from 0 to 1,000,000,000. |
| `invalidItems` | Nonempty rows with missing, empty, or invalid IDs. |
| `duplicateItems` | Valid rows beyond the first occurrence of each normalized ID. |

IDs may be nonempty strings or finite numbers. Their string forms are trimmed before comparing, so `1`, `"1"`, and `" 1 "` count as one ID. Duplicates reduce the distinct count but do not independently fail the check. Empty objects are ignored, including n8n’s empty-batch placeholder. With minimum zero, an empty batch is healthy; any invalid nonempty row still fails.

This checks IDs and counts. It does not establish that upstream work was correct, detect a run that never started, or catch errors before the check. A failed check is returned as report data, not thrown as a workflow error. Invalid configuration fails the workflow.

## Changes to the source

*   Expose completed records as a real input in Open Flow and a replaceable input step in n8n.
*   Retain the independent local check, including zero records and n8n’s empty-output placeholder.
*   Return the report without the optional external receipt branch or fixed demo-case selector.

Adapted from the **completed-output validation component** of [Detect Empty Workflow Outputs with an Optional Keptick Receipt](https://github.com/enescingoz/awesome-n8n-templates/blob/827110332c21cbe000ab13f6d292d5adb1f1f8db/devops/Detect%20Empty%20Workflow%20Outputs%20with%20an%20Optional%20Keptick%20Receipt.json) in [enescingoz/awesome-n8n-templates](https://github.com/enescingoz/awesome-n8n-templates).

Original workflow made by **Keptick, with AI assistance**. No affiliation with n8n.

Source collection notice: © 2024–2026 Enes Cingoz, [CC BY 4.0](https://github.com/enescingoz/awesome-n8n-templates/blob/827110332c21cbe000ab13f6d292d5adb1f1f8db/LICENSE). The adaptation changes are listed above; see [repository licensing](https://github.com/oomol-lab/awesome-workflow-templates/blob/f2bf5895d91486412f320151dafd9c6b95b42091/README.md#licensing) for the scope of OOMOL contributions and third-party material.

## 設定需求

*   Completed records as JSON objects
*   Record ID field and minimum expected count

*   validation
*   records
*   monitoring
*   outputs

[在 GitHub 查看](https://github.com/oomol-lab/awesome-workflow-templates/blob/f2bf5895d91486412f320151dafd9c6b95b42091/workflows/output-completion-check/README.md)
