There is a standard single step workflow that is provided but most people want a little more functionality than what is provided SAP standard. In the below example I am triggering workflow WS91000027 (custom). In the workflow we create a branch step where only one of the branches have to complete. The first branch goes to the agent that has to complete the task and the 2nd is a wait step where it waits for a successful posting event (INPUTSUCCESS). The background job RBDMANIN is scheduled to try and repost IDocs in error - If it is successful then it will raise this event and the workflow will be terminated. This is desirable so that only valid errors remain in the agents inbox.
INPUTERROROCCURRED is triggered when the IDoc fails to post. It will then search for linked workflows (configured using transaction SWETYPV) to see what workflow to trigger.
I often get asked how IDocs and workflow are connected.... The diagram below should clear up the confusion.Use transaction WE42 to ensure that the relevant IDoc object is linked to the needed events that workflow uses.