Trigger workflow on record deletion

I am working on a project where products are created and updated according to a custom object record and its properties. If the custom object is updated, the product gets updated.
Is there a way to trigger a workflow when the custom object is deleted? I wasn’t sure if I could use Object Id and “is unknown” as a trigger for “deletion” or if there is another way. I haven’t found any documentation on this yet.

Hi @nikan,

This is currently not supported in workflows, unfortunately. Workflows enroll records one by one and then execute the workflow actions – if a record has been deleted before, it can’t enroll in the workflow anymore.

Could you provide more context as to why the object records needs to be deleted? There are probably ways of putting the custom object records out of sight and trigger your workflows in a different way.

Best regards!

Hi Karsten,

For custom objects it is a conundrum.

The API does not support custom objects while it supports deletion events for standard objects.

Workflows support custom objects, but do not support deletion events.

No idea what to do :disappointed_face:

Hi Karsten,

Thank you for your reply.

I can not give you the answer to your question - why the object needs to be deleted. I guess an end user could answer that question. There is the “Delete” button in the UI, sooner or later it will be clicked, for variety of reasons. I am just a dev not an end user, I need to replicate user’s actions in another application, be it insert, update or delete.

Positive regards!

Raf

This would be a really nice addition to prevent orphaned object records from hanging out after a parent record is deleted.

As a possible workaround, maybe you can create a list with all custom objects and record id is known. As a trigger you can than select removed from list. This would trigger the workflow if the custom object is deleted I think.

I have tried the above, it did not work.