Workflow Messaging uses Workflow system events to execute operations involving two-way communication (send and receive message). A system event is automatically created when you create an on-ramp for two-way communication, which includes two-way Web Services Publishing operations, custom XML on-ramps, and External AutoFill Keyword Set on-ramps.
You can add Workflow rules and actions to a system event to be executed when an incoming message triggers the event. For example, use the Set Message Item Response action to set the body of the response message that is sent to the external application calling the web service.
When designing the Workflow logic for a system event, it is considered a best practice to keep a work item present in only one task list at a time and to process it in a procedural manner.
See the section on system events in the Workflow documentation for general information on creating and configuring system events.