not syncing after excuting Stored Procedure

Certified Associate Developer

I'm trying to delete using a delete action inside interface using a stored procedure because I also need to delete related data from other tables. However, I'm facing an issue: the entity is successfully deleted from the database, but it still appears in Appian.

I have a subprocess that runs after the stored procedure to sync all the updated tables, but the entity remains visible in Appian until I manually trigger a sync—after which it disappears as expected.

Does anyone have any idea what could be causing this issue? Any insights would be greatly appreciated!

here u can see the main subprocess sync :

and an example of one subprocess sync:

  Discussion posts and replies are publicly visible