removeEmailMsg Step

Use this feature to remove a stored email message from a trigger while executing a workflow.

Last published at: September 8th, 2026

Description:

The Remove Email Msg workflow step removes a stored email message associated with a trigger during workflow execution.

The step supports:

  • Specifying the message ID of the stored email message.
  • Using a Variable or Global variable that contains the message ID.
  • Dynamically determining the email message to remove.
  • Removing a stored email message as part of workflow processing.
  • Performing email-message cleanup after the message has been processed.
  • Returning a True or False result for subsequent workflow processing.

 

Inputs

  • msgIDVariable - The msgIDVariable property specifies the Variable or Global variable that contains the ID of the stored email message to be removed.
 

 

Returns

  • True – The True return path can be connected to the next workflow activity when the removal operation produces the expected result.
  • False – The False return path can be used for an alternative workflow path or appropriate handling when the expected result is not produced.
 

 

Usage:

The Remove Email Msg step is typically placed after a workflow has received and processed a stored email message and no longer needs that message to remain associated with the trigger.

The workflow supplies the message ID through a Variable or Global variable.

A typical workflow pattern is:

Email Trigger → Process Email → Remove Email Msg → Continue Process

The step can therefore serve as a cleanup activity after email-triggered processing.

Because the operation acts on a stored message identified by its message ID, make sure the value supplied to msgIDVariable identifies the intended message.

 

To use this step, the email trigger should be configured in the FlowWright application.

 

Typical Workflow Suggestions:

Remove a Processed Email Message

Use the step after an email-triggered workflow has completed processing the message.

Example:

Email Trigger → Process Email → Remove Email Msg → Complete

The workflow processes the incoming message and then supplies its message ID to the Remove Email Msg step.

 

Clean Up After Email Processing

Use the step as a cleanup activity after all required information has been extracted from the stored email.

Example:

Email Trigger → Extract Email Data → Process Data → Remove Email Msg

This pattern can be useful when the stored message is only needed during the workflow is processing.

 

Remove a Message After Successful Processing

Place the step after the activities that consume the email message.

Example:

Receive Email → Validate Message → Process Message → Remove Email Msg → Continue

This ensures that message removal is positioned after the primary processing activities.

 

Use a Variable to Identify the Message

The msgIDVariable property accepts a string value and is intended to reference a Variable or Global containing the message ID.

Example:

Email Trigger → Store Message ID → Remove Email Msg → Continue

This allows the workflow to operate on the message identified during execution.

 

Use a Global Variable for the Message ID

Use a Global variable when the message ID is made available to the workflow through a Global value.

Example:

Retrieve Message Information → Remove Email Msg → Continue Process

The Global variable supplies the message ID required by the step.

 

Remove an Email After Extracting Its Data

Use the next step after extracting the required information from the email.

Example:

Email Trigger → Extract Subject/Body/Data → Store Results → Remove Email Msg

The workflow can retain the extracted information in Variables while removing the stored email message.

 

Remove a Message After Business Processing

Use the step after the email has been used to initiate or complete a business process.

Example:

Email Trigger → Create Request → Process Request → Remove Email Msg → Complete

This separates email processing from message cleanup.

 

Route Processing After Message Removal

Use the True and False return paths to control subsequent workflow processing.

Example:

Remove Email Msg

True: Continue Process

False: Handle Removal Result

The step provides both True and False return values.

 

Handle a False Result

Connect the False return path to an appropriate workflow activity when the expected removal result is not obtained.

Example:

Remove Email Msg → False → Handle Cleanup Result

This gives the workflow an explicit path for the non-True result.

 

Perform Email Cleanup at the End of a Workflow

Use Remove Email Msg near the end of an email-processing workflow.

Example:

Receive Email → Process Request → Send Notification → Remove Email Msg → End

This makes message cleanup a clearly defined final stage of the workflow.

 

Preserve Required Information Before Removal

Use workflow activities to extract and store any information required from the email before removing the stored message.

Example:

Email Trigger → Extract Message Information → Store Values → Remove Email Msg

This pattern separates information processing from message cleanup.

 

Use the Step in Email-Triggered Automation

The step can be used as part of an email-driven workflow in which an incoming stored message initiates processing.

Example:

Email Trigger → Validate Email → Process Request → Remove Email Msg → Complete

The XML explicitly describes the operation as removing the stored email message from trigger.

 

Example:

Let’s build and execute the “removeEmailMsgDef” example.          

  • Create a new process definition called “removeEmailMsgDef” and open it in Designer mode.
  • Drag the “removeEmailMsg” step to the canvas. 
  • Connect the dots between the “Start” and the “removeEmailMsg” steps, as shown above. 
  • Select the line between the steps to configure the “Connection Properties”. The default property values are “None, True, False, Error, and Evaluate”. Depending on the step’s purpose, additional values are available for configuration.
  • Define a variable or a global to store the result. 
  • Click the “executeSQL” step to configure its “Required” properties. Enter a step name. Select the connection string from the drop-down list. Enter the SQL statement to retrieve email message records from the deEmailMsgs table. Select XML as the result format. Click the Save button. Note: Click the "AI Predict" button to have the Copilot add new process steps that match your process description. 

 

  • Click the “getEmailMsg” step to configure its “Required” properties. Provide a step name. Provide a variable or global to store the message ID, sender and recipient email addresses, message content, and file lists. Then click the Save button. Note: Click the "AI Predict" button for the Copilot to add new process steps that match your process description. 

 

  • Click the “removeEmailMsg” step to configure its “Required” properties. Enter a step name. Enter a variable or a global reference to store the message ID. Click the Save button. Note: Click the "AI Predict" button to have the Copilot add new process steps that match your process description. 

 

  • The “Logging” configuration is necessary for documentation and also measures workflow progress and percent complete. This is achieved by configuring the step state and percent fields individually, as shown in the images below. Configure the “Logging” using the following properties.

 

  • Save the process definition, create a new instance, and execute it. Render the process instance and click the process step to view its properties. When the workflow reaches the Remove Email Msg step, FlowWright uses the configured msgIDVariable value to identify the stored email message associated with the trigger. The step is explicitly defined as “Removes the stored email message from trigger.” The workflow can then follow the True-or-False return path defined for the step.

 

Tips:

  • Verify that msgIDVariable contains the intended stored email message ID before the step executes.
  • Use a meaningful Variable or Global variable name for the message ID.
  • Make sure the message ID is available throughout the workflow until the cleanup step executes.
  • Test the workflow with representative email-triggered processes before deploying it.
  • Verify that all required information has been extracted from the email before removing the stored message.
  • Place Remove Email Msg after downstream activities that depend on the stored email message.
  • Avoid removing the message before all required email processing has completed.
  • Consider connecting both the True and False return paths to appropriate subsequent workflow activities.
  • Provide appropriate handling for a False result.
  • Use Logging to document email-message cleanup when the operation needs to be traceable.
  • Test the workflow when the supplied message ID is missing or invalid.
  • Test scenarios where the stored message is no longer available when the step executes.
  • Verify that any Variables containing information extracted from the email are populated before removing the message.
  • Use a consistent pattern for storing and referencing email message IDs across email-triggered workflows.
  • Use meaningful workflow step names that describe why the email message is being removed.
  • Review the workflow execution order carefully when several activities depend on the same stored email message.
  • Consider placing message removal near the end of the workflow when the stored message is needed throughout processing.
  • Do not assume that removing the stored email message also removes Variables or other workflow data populated from the message.
  • Do not assume that the False return value represents a particular error condition unless confirmed by the FlowWright implementation.
  • Do not assume additional behavior such as deleting the original email from an external mailbox unless confirmed by the FlowWright implementation.
  • Do not assume message-retention, recovery, or archival behavior beyond what is defined by the FlowWright implementation.

 

Notes:

  • The Remove Email Msg step is defined in the Engine category with the internal name removeemailmsg, label “Removes the stored email message from trigger,” namespace FlowWright.Workflow.RemoveEmailMsg, and display name “Remove Email Msg.”
  • The step is implemented by FlowWright.Workflow.RemoveEmailMsg in FlowWright.Workflow.dll and is defined as a Process step with 2 incoming connections and 2 outgoing connections.
  • The step defines one required property:
    • msgIDVariable – Variable/Global that holds the message ID. 
  • The msgIDVariable property uses the string data type, implemented by FlowWright.DataTypes.ClsTextBox in FlowWright.DataTypes.dll.
  • The step provides two return values:
    • False
    • True

 

Definition Sample:

You may provide a sample definition for the Remove Email Msg step for download and later import it into the FlowWright Process Definition XML page.

Note: Verify and complete any missing configuration after importing the sample, including:

  • Message ID.
  • Variable or Global variable containing the message ID.
  • Workflow Variable references.
  • Email-trigger configuration.
  • Environment-specific settings.
  • Target stored email message.
  • Downstream True and False workflow paths.
  • Logging configuration.
  • Any downstream activities that depend on the stored message.

After verifying the configuration, save the Process Definition before execution.

Click here to download the sample file.