I have created a custom queue that imports entities from an external api. During each queue item process I want to save the id of the created/updated entity, and at the end of the queue I want to use those ids to determine which entities should no longer exist and be deleted.
Is there a way to run a function at the end of a queue? And if so, how can I store the ids that I need and pass it to this function?
If I am thinking about this the wrong way, please let me know if there is another way!