you could try to connect the DB note with the note where you delete the file via FlowVariable connection. This way, the second node will only run after the first node executed fine. However, this depends on the first node to fail if an error occurs.
Another option you could try is to use the If Switch node. This node has one input and two outputs and will forward the input to the output depending on a flow variable boolean (see node description of the If Switch node). The other output will be deactivated, meaning that all consecutive nodes will not run.