# Script Action is not executed when it exists in a Rule with other Actions

**URL:** <https://community.fibery.io/t/script-action-is-not-executed-when-it-exists-in-a-rule-with-other-actions/5503>\
**Category:** Bugs & Issues\
**Tags:** automations\
**Created:** [December 8, 2023, 4:07am UTC](https://community.fibery.io/t/script-action-is-not-executed-when-it-exists-in-a-rule-with-other-actions/5503 "2023-12-08T04:07:42Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Matt\_Blais](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/matt_blais/32/1464_2.png) [@Matt\_Blais](https://community.fibery.io/u/Matt_Blais)\
**Post date:** [December 8, 2023, 4:07am UTC](https://community.fibery.io/t/script-action-is-not-executed-when-it-exists-in-a-rule-with-other-actions/5503/1 "2023-12-08T04:07:43Z")

</div>

I have a Rule with **three Actions** , and the middle action is a script:

 ![image](https://us1.discourse-cdn.com/flex020/uploads/fibery/original/2X/7/706dcbd8b55ae9aa52394503319a58a80099f2e2.png)

No output from `console.log()` is visible in the Activity tab - which also says “Not Started” - did the script Action not get run?

The two “Update” Actions in the Rule (labeled #2 and #4 above) are definitely getting executed correctly when the Rule is triggered. But not the Script Action.

 ![image](https://us1.discourse-cdn.com/flex020/uploads/fibery/original/2X/0/06b3036843577a594f5fe6548de1ab5c9f936396.png)

If I remove the two “Update” Actions so the Rule has _only_ the Script action, **then it works as expected** (the output from `console.log()` output appears in the Activity tab).

What’s happening here?

😕

---

<div class="post-metadata">

**Author:** ![Sergey\_Truhtanov](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/sergey_truhtanov/32/13986_2.png) [@Sergey\_Truhtanov](https://community.fibery.io/u/Sergey_Truhtanov)\
**Post date:** [December 12, 2023, 3:15pm UTC](https://community.fibery.io/t/script-action-is-not-executed-when-it-exists-in-a-rule-with-other-actions/5503/2 "2023-12-12T15:15:23Z")

</div>

Just fyi: we are looking this, but haven’t found root cause yet. Do you reproduce this regularly?

---

<div class="post-metadata">

**Author:** ![Matt\_Blais](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/matt_blais/32/1464_2.png) [@Matt\_Blais](https://community.fibery.io/u/Matt_Blais)\
**Post date:** [December 12, 2023, 4:39pm UTC](https://community.fibery.io/t/script-action-is-not-executed-when-it-exists-in-a-rule-with-other-actions/5503/3 "2023-12-12T16:39:13Z")

</div>

@Sergey_Truhtanov , Yes, it has been consistent, and observed in two separate Workspaces.

Let me know if I can help.

---

<div class="post-metadata">

**Author:** ![Sergey\_Truhtanov](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/sergey_truhtanov/32/13986_2.png) [@Sergey\_Truhtanov](https://community.fibery.io/u/Sergey_Truhtanov)\
**Post date:** [December 12, 2023, 7:39pm UTC](https://community.fibery.io/t/script-action-is-not-executed-when-it-exists-in-a-rule-with-other-actions/5503/4 "2023-12-12T19:39:17Z")

</div>

I’ve did just the same setup locally with 2 actions and script between them and didn’t reproduce the problem. If you can make a template, reproduce by installing that template into some workspace, and then share a template with me, that would be very helpful indeed.

In the meantime I’ll try other steps to reproduce or will extend logging.

---

<div class="post-metadata">

**Author:** ![Matt\_Blais](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/matt_blais/32/1464_2.png) [@Matt\_Blais](https://community.fibery.io/u/Matt_Blais)\
**Post date:** [December 13, 2023, 4:48am UTC](https://community.fibery.io/t/script-action-is-not-executed-when-it-exists-in-a-rule-with-other-actions/5503/5 "2023-12-13T04:48:42Z")

</div>

I tried the export but the issue does not reproduce in the test Workspace where I imported it 😠

I do have two different workspaces where it does reproduce, so if it helps I can give you access to one of those - LMK.

---

<div class="post-metadata">

**Author:** ![Sergey\_Truhtanov](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/sergey_truhtanov/32/13986_2.png) [@Sergey\_Truhtanov](https://community.fibery.io/u/Sergey_Truhtanov)\
**Post date:** [December 13, 2023, 10:26am UTC](https://community.fibery.io/t/script-action-is-not-executed-when-it-exists-in-a-rule-with-other-actions/5503/6 "2023-12-13T10:26:26Z")

</div>

Oh, I’ve checked this rule config, and it appeared it is broken.  
Question is how it appeared so. Maybe there is a bug on UI part, which saves incorrect configuration. Or if you did this via api – then bug may be on your side.

As you are familiar with this internal api, you may look yourself:

```auto
                "id": "7906bad7-8aaa-457e-9b98-5bdfae469f8b",
                "action": "script-4fe9df50-8355-11ee-b49b-3b031a8172e4",
                "args": {
                    "script": {
                        "type": "value",
                        "value": "console.log('Exec Test 1')"
                    },
                    "fields": {
                        "type": "value",
                        "value": {
                            "f30ce8f0-bb87-4dae-a5d8-557fb64f9812": {
                                "type": "empty"
                            }
                        }
                    }
                }

```

Here “field update” and “script” action are in one Action, but it should be separate actions.  
You may re-create same rule via UI and see how config actually should look like.

Our UI code somehow managed to display config in a way you see it. But it should just show an error I guess. Anyway we never tested UI on incorrect rule configuration :-). Validation on backend has also passed, as we strictly check only concrete keys.

Also notice that 2 actions have the same “id”. This is another place where our validation should check for such scenario, but it didn’t. I guess that’s why second action is never executed.

---

<div class="post-metadata">

**Author:** ![Matt\_Blais](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/matt_blais/32/1464_2.png) [@Matt\_Blais](https://community.fibery.io/u/Matt_Blais)\
**Post date:** [December 13, 2023, 4:19pm UTC](https://community.fibery.io/t/script-action-is-not-executed-when-it-exists-in-a-rule-with-other-actions/5503/7 "2023-12-13T16:19:44Z")

</div>

@Sergey_Truhtanov Thank you!

This was certainly my fault - the dangers of using undocumented APIs 😅
