question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Break a Flow chain

See original GitHub issue

I’ve made a nested flow jobs,

{
    "queueName": "Predictions",
    "data": {
        "uuid": "123"
    },
    "name": "notifyWebhook",
    "children": [
        {
            "queueName": "Predictions",
            "data": {
                "uuid": "123"
            },
            "name": "predict",
            "children": [
                {
                    "queueName": "Predictions",
                    "data": {
                        "uuid": "123"
                    },
                    "name": "transcript",
                    "children": [
                        {
                            "queueName": "Predictions",
                            "data": {
                                "uuid": "123"
                            },
                            "name": "cutPromo",
                            "children": [
                                {
                                    "queueName": "Predictions",
                                    "data": {
                                        "uuid": "123"
                                    },
                                    "name": "download"
                                }
                            ]
                        }
                    ]
                }
            ]
        }
    ]
}

There is any way to break the flow chain if the download job fails?

I’ve tried to throw new exception, I see the download job fails, but all the jobs that are dependent on it are still exists in redis.

What I want is to be able to remove the entire chain if download job is failed.

Any suggestions?

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
manastcommented, May 19, 2021

flows are a quite new feature so we are still adding functionality. Failing a flow when one of the jobs fails could be one of them.

2reactions
ccolliecommented, May 18, 2021

From a cursory look, we can get the parent id from the job, then get the wait children key based on that. From there we can cancel all children jobs by id using the API.

I think it would be a good candidate for a PR, in addition to the basic operation of getting all jobs relating to a Flow.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to escape or break the chain flow in underscore/lodash
Show activity on this post. Here is a lodash chain that returned an ordered, uniquely sorted array of integer. Because the input can...
Read more >
What is Flow? A complete guide to the Flow blockchain
The Flow Blockchain helps power some of the most popular apps, games, and digital assets. Here's everything you need to know.
Read more >
Flow (@flow_blockchain) / Twitter
Infrastructure | Flow was built not to break under the stress of major NFT collections. Founded by the team behind one of the...
Read more >
break - JavaScript - MDN Web Docs - Mozilla
The break statement terminates the current loop, switch, or label statement and transfers program control to the statement following the ...
Read more >
7.10 Break and Continue Statements | Stan Reference Manual
The one-token statements continue and break may be used within loops to alter control flow; continue causes the next iteration of the loop...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found