# Correct way to make a trigger, 1 out of 5 not fired?

**URL:** <https://community.neo4j.com/t/correct-way-to-make-a-trigger-1-out-of-5-not-fired/72817>\
**Category:** Neo4j Graph Platform\
**Tags:** apoc, cypher\
**Created:** [February 27, 2025, 8:31am UTC](https://community.neo4j.com/t/correct-way-to-make-a-trigger-1-out-of-5-not-fired/72817 "2025-02-27T08:31:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![f1-outsourcing](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/f1-outsourcing/32/29443_2.png) [@f1-outsourcing](https://community.neo4j.com/u/f1-outsourcing)\
**Post date:** [February 27, 2025, 8:31am UTC](https://community.neo4j.com/t/correct-way-to-make-a-trigger-1-out-of-5-not-fired/72817/1 "2025-02-27T08:31:58Z")

</div>

I was wondering if this the correct way to make a trigger

```auto
CALL apoc.trigger.add(
  'setCreatedProperty',
  'UNWIND $createdNodes AS n SET n.created = timestamp()',
  {phase: "afterAsync"}
)

```

Yesterday I accidentally noticed one of my test nodes does not have this created field.

```auto
╒═════════════════════════════════════════════╕
│n │
╞═════════════════════════════════════════════╡
│(:Person {created: 1740608142752,name: "p1"})│
├─────────────────────────────────────────────┤
│(:Person {name: "p2"}) │
├─────────────────────────────────────────────┤
│(:Person {created: 1740608155923,name: "p3"})│
├─────────────────────────────────────────────┤
│(:Person {created: 1740608230117,name: "p4"})│
├─────────────────────────────────────────────┤
│(:Person {created: 1740608237464,name: "p5"})│
└─────────────────────────────────────────────┘

```

There is a bit of disclaimer here, as I am also testing with adding nodes through a plugin. But I guess on the other hand that should not be allowed to mess up this trigger behaviour.

> **[Triggers - APOC Documentation](https://neo4j.com/docs/apoc/current/background-operations/triggers/)**
>
> This section describes procedures that can be used to register triggers whenever data in Neo4j is created, updated, or deleted.
