# Workflows fail when triggered, but succeed when run manually

**URL:** <https://community.n8n.io/t/workflows-fail-when-triggered-but-succeed-when-run-manually/25575>\
**Category:** Questions\
**Tags:** code\
**Created:** [April 25, 2023, 5:16pm UTC](https://community.n8n.io/t/workflows-fail-when-triggered-but-succeed-when-run-manually/25575 "2023-04-25T17:16:13Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![browland](https://avatars.discourse-cdn.com/v4/letter/b/edb3f5/32.png) [@browland](https://community.n8n.io/u/browland)\
**Post date:** [April 25, 2023, 5:16pm UTC](https://community.n8n.io/t/workflows-fail-when-triggered-but-succeed-when-run-manually/25575/1 "2023-04-25T17:16:13Z")

</div>

A recent upgrade to n8n has broken several workflows in our system that were previously working well.

One such workflow does some date math that previously worked. Here it is returning null:

 ![image](https://europe1.discourse-cdn.com/n8n/original/3X/f/5/f5b6c22afcb2f2ed3d825bace16ae5031f75226c.png)

When I manually execute this node, it successfully computes the difference between the dates.

 ![image](https://europe1.discourse-cdn.com/n8n/original/3X/4/e/4ef5d6b5ab24f46a4108b0f7bcd180bbcf246a8a.png)

I moved to the :next version 0.225.2 after reading some recent release notes, but this hasn’t resolved the issue.

n8n is self-hosted on linux using docker / docker-compose

---

<div class="post-metadata">

**Author:** ![jan](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jan/32/9_2.png) [@jan](https://community.n8n.io/u/jan)\
**Post date:** [April 25, 2023, 6:32pm UTC](https://community.n8n.io/t/workflows-fail-when-triggered-but-succeed-when-run-manually/25575/2 "2023-04-25T18:32:16Z")

</div>

Welcome to the community @browland !

Sorry to hear that you have problems. Do you know which version you used before?

---

<div class="post-metadata">

**Author:** ![browland](https://avatars.discourse-cdn.com/v4/letter/b/edb3f5/32.png) [@browland](https://community.n8n.io/u/browland)\
**Post date:** [April 25, 2023, 6:41pm UTC](https://community.n8n.io/t/workflows-fail-when-triggered-but-succeed-when-run-manually/25575/3 "2023-04-25T18:41:19Z")

</div>

Thanks! n8n is a terrific product.

This worked for many versions over the past several months. I think the last version it worked on was 0.218.0. Then I updated last week and it stopped working, which I believe was 0.223.0. I updated yesterday, and also tried updating to :next. Those exhibit the same behavior.

---

<div class="post-metadata">

**Author:** ![jan](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jan/32/9_2.png) [@jan](https://community.n8n.io/u/jan)\
**Post date:** [April 25, 2023, 7:27pm UTC](https://community.n8n.io/t/workflows-fail-when-triggered-but-succeed-when-run-manually/25575/4 "2023-04-25T19:27:06Z")

</div>

Thanks a lot, that is great to hear that you generally enjoy it even if it it seems like something got messed up.

Where do the values from `DateCreatedUtc` come from? Do you know of what type they are? Assume it is not a `String`?

---

<div class="post-metadata">

**Author:** ![browland](https://avatars.discourse-cdn.com/v4/letter/b/edb3f5/32.png) [@browland](https://community.n8n.io/u/browland)\
**Post date:** [April 25, 2023, 8:55pm UTC](https://community.n8n.io/t/workflows-fail-when-triggered-but-succeed-when-run-manually/25575/5 "2023-04-25T20:55:46Z")

</div>

It’s coming from a datetime field in sql server. It is presented to this workflow step as a string and then converted. It does work properly when I manually run the individual step, but not when the entire workflow is triggered automatically.

```auto
[
  {
    "DateCreatedUtc":[
      "2023-04-25T10:07:03.483Z",
      "2023-04-25T10:05:32.810Z"
    ]
  }
]

```

---

<div class="post-metadata">

**Author:** ![jan](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jan/32/9_2.png) [@jan](https://community.n8n.io/u/jan)\
**Post date:** [April 26, 2023, 6:51am UTC](https://community.n8n.io/t/workflows-fail-when-triggered-but-succeed-when-run-manually/25575/6 "2023-04-26T06:51:29Z")

</div>

Thanks a lot @browland! Could reproduce it and found a problem that got introduced with `0.221.x` by a feature that was supposed to reduce the memory required by the Code-Node. Apparently it has also other unintended consequences. I talked with @netroy about it, he will have a deeper look.

---

<div class="post-metadata">

**Author:** ![browland](https://avatars.discourse-cdn.com/v4/letter/b/edb3f5/32.png) [@browland](https://community.n8n.io/u/browland)\
**Post date:** [April 26, 2023, 12:04pm UTC](https://community.n8n.io/t/workflows-fail-when-triggered-but-succeed-when-run-manually/25575/7 "2023-04-26T12:04:25Z")

</div>

Ok, thanks for looking at that. We have noticed a couple of other problems after this update so perhaps these are related. For instance:

> [@Set node error on triggered execution](http://community.n8n.io/t/set-node-error-on-triggered-execution/25576):
>
> I have a workflow that has stopped working after updating n8n. The execution fails when the webhook is triggered, however it succeeds when the failed execution is retried manually. The error is on my SET node and gives the following error: (ERROR: Cannot read properties of undefined (reading ‘name’)) n8n version: 0.225.2 Self-hosted Docker

---

<div class="post-metadata">

**Author:** ![browland](https://avatars.discourse-cdn.com/v4/letter/b/edb3f5/32.png) [@browland](https://community.n8n.io/u/browland)\
**Post date:** [April 27, 2023, 4:18pm UTC](https://community.n8n.io/t/workflows-fail-when-triggered-but-succeed-when-run-manually/25575/8 "2023-04-27T16:18:17Z")

</div>

Thanks @jan and @netroy. Let me know if you open an issue for this; I can track that rather than ask you about it.

---

<div class="post-metadata">

**Author:** ![netroy](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/netroy/32/22154_2.png) [@netroy](https://community.n8n.io/u/netroy)\
**Post date:** [April 28, 2023, 6:09am UTC](https://community.n8n.io/t/workflows-fail-when-triggered-but-succeed-when-run-manually/25575/9 "2023-04-28T06:09:41Z")

</div>

@browland we released a potential fix for this in `0.226.0`. Can you please try upgrading, and tell us if it fixes the issue?

---

<div class="post-metadata">

**Author:** ![browland](https://avatars.discourse-cdn.com/v4/letter/b/edb3f5/32.png) [@browland](https://community.n8n.io/u/browland)\
**Post date:** [April 28, 2023, 4:40pm UTC](https://community.n8n.io/t/workflows-fail-when-triggered-but-succeed-when-run-manually/25575/10 "2023-04-28T16:40:53Z")

</div>

No, sorry, I’m still seeing the same issue.

---

<div class="post-metadata">

**Author:** ![browland](https://avatars.discourse-cdn.com/v4/letter/b/edb3f5/32.png) [@browland](https://community.n8n.io/u/browland)\
**Post date:** [May 1, 2023, 5:34pm UTC](https://community.n8n.io/t/workflows-fail-when-triggered-but-succeed-when-run-manually/25575/11 "2023-05-01T17:34:12Z")

</div>

Hi @netroy, 0.226.0 didn’t resolve the issue. We downgraded to 0.218.0 and our broken workflows are working again properly.

(We did find that some more recent nodes in other workflows broke as part of this downgrade and we had to recreate some of them.)

Let me know if there is any other information I could provide you that would help identify this. Thank you for your help!

---

<div class="post-metadata">

**Author:** ![jan](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jan/32/9_2.png) [@jan](https://community.n8n.io/u/jan)\
**Post date:** [May 2, 2023, 10:17am UTC](https://community.n8n.io/t/workflows-fail-when-triggered-but-succeed-when-run-manually/25575/12 "2023-05-02T10:17:27Z")

</div>

New version [`n8n@0.226.1`](https://github.com/n8n-io/n8n/releases/tag/n8n%400.226.1) got released which includes the [GitHub PR 6086](https://github.com/n8n-io/n8n/pull/6086).

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/system/32/195824_2.png) [@system](https://community.n8n.io/u/system)\
**Post date:** [July 31, 2023, 10:18am UTC](https://community.n8n.io/t/workflows-fail-when-triggered-but-succeed-when-run-manually/25575/13 "2023-07-31T10:18:16Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
