--- title: "Get Headers Step" slug: "get-headers-step" tags: ["POP", "imap", "email", "Server"] updated: 2025-07-09T13:16:24Z published: 2025-07-09T13:16:24Z canonical: "documentation.decisions.com/get-headers-step" --- > ## Documentation Index > Fetch the complete documentation index at: https://documentation.decisions.com/llms.txt > Use this file to discover all available pages before exploring further. # Get Headers Step | ## Step Details | | --- | | **Introduced in Version** | --- | | **Modified in Version** | 8.17.0, 8.6.0, 7.14.0 | | **Location** | Communication > Email > IMAP/POP | The Get Headers step for IMAP and POP email servers returns the header data of a specified number of emails from the user's configured email server. --- ## Properties #### Gmail | Property | Description | Data Type | | --- | --- | --- | | Use Recent Flag | Using pop with Gmail will not retrieve all messages. Using the recent flag will get Gmail to return messages from the last 30 days. **Note:** The "Use Recent Flag" setting must be used on BOTH the "Get Header" step and the "[Get Email](/step-library/docs/get-email)" step to return the most recent emails; if Use Recent Flag is enabled on the "Get Header" step but not enabled on the "Get Email" step, then it will return no emails found. | Boolean | #### Input | Property | Description | Data Type | | --- | --- | --- | | Count | Specifies the number of email headers to return | Int32 | | OAuth Token | Allows a user to specify the IMAP or POP3 email server token. (Requires: email account configured for OAuth and POP3 or IMAP; [OAuth Provider](https://documentation.decisions.com/docs/establishing-an-oauth-provider) and [Token](https://documentation.decisions.com/docs/creating-oauth-tokens) for POP3 or IMAP) | String | | Password | The password of the user connecting to the email server | String | | Port | The port number of the email server | Int32 | | Secure Connection | Used if the email server credentials require a secure connection (must be set to true when using OAuth for POP3 or IMAP) | Boolean | | Server | IMAP or POP email server | String | | Sort Descending | When enabled, this will reverse the order of the messages before retrieving headers so that the newest messages will be returned by the step. | Boolean | | Use OAuth | Specifies the use of OAuth authentication | Boolean | | Username | Username to connect to the email server | String | #### Output | Property | Description | Data Type | | --- | --- | --- | | Headers | List of the email header data found | EmailHeader list | ![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/image-1664484721948.png) --- ## Example 1. Create a new [Scheduled Job](/v9/docs/understanding-scheduled-jobs) 2. Enter "Email Check" under **Scheduled Job Name** then click PICK SCHEDULED FLOW. Click CREATE and [create a new Flow.](/v9/docs/create-a-flow) ![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/image-1647359885105.png) 3. Attach a **Get Headers** step from the **COMMUNICATION >** **EMAIL > POP** category in the **Toolbox** panel to the **Start** step. 4. On the Properties panel, enter "10" under the **Count** field. 5. Constant map the Email Servers information for the **Username**, **Password**, **Server**, and **Port**. ![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/image-1647366092137.png) 6. Attach a **ForEach Step** from the **FLOW MANAGEMENT >** **ITERATION** category in the Toolbox panel to the **Received** path of the Get Headers step. 7. On the Properties panel. **Select From Flow** map **Headers** to **Collection**. Mapping the Collection Input will automatically adjust the Type under DATA, to its corresponding Data Type. This will allow the ForEach Step to pass EmailHeader data through the Flow.  ![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/image-1647366166914.png) 8. Attach the Done path to the **End** step, then attach a **Get Email** step from **COMMUNICATION > EMAIL > POP**. On the Properties panel, configure the inputs to match the settings from the Get Headers step. Click **Unknown** next to the **Unique** **Id** field and select Select From Flow. Select **Headers. All UniqueId.First** and click DONE. ![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/image-1647366253855.png) 9. Connect the **Not Found** path to the End step. 10. Attach the **Found** path to any desired Email processing Flows running as an [Asynchronous Sub Flow](/v9/docs/about-sync-and-async-sub-flows). When using an Email processing Sub Flow, define the Output Message data from the Get Email step as the Input for the Sub Flow, to allow the Flow to transfer all information through the Sub Flow and back.  ![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/image-1647361063708.png) 11. Click Save to save changes to the Flow and close the Flow. 12. Back in the **New Scheduled Flow** window, scroll down to **Calendar** under **Schedule Configuration**. Select **Time Span Schedule** from the dropdown menu. ![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/image-1647361363870.png) 13. Navigate to **Time Span Schedule Information** and configure the values to the desired time. Click Save. The proper configuration of this example allows the Flow to check for new emails on a POP server, then process those emails via process logic in an Async Sub Flow.  ![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/image-1647361509524.png) --- ## Step Changes | Description | Version | Developer Task | | --- | --- | --- | | Added two new properties: Use Recent Flag and Sort Descending for the Get Email Step and Get Headers Step. | [8.17](https://documentation.decisions.com/v99/docs/version-8x) | DT-038377 | --- Related Information Forum Posts: [Using Email Steps with Gmail Issue](https://community.decisions.com/discussion/28107/using-email-steps-with-gmail-issue) ## Related - [Send Email](/send-email.md) - [Send Email to Contact Steps](/send-email-to-contact-steps.md) - [Get Email](/get-email.md) - [Delete Email](/delete-email.md) - [Send Email with Custom Server](/send-email-with-custom-server.md)