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

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

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.

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?

:confused:

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

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

Let me know if I can help.

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.

1 Like

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

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

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:

                "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.

@Sergey_Truhtanov Thank you!

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