In many BizTalk integrations, the business key you need for routing and tracking isn’t inside the payload—it’s in the incoming file name.
That’s especially common with legacy batch drops, SFTP deliveries, and partner-driven naming conventions where the file name carries information like:
- Partner code
- Document type
- Country/region
- Batch identifier
- Business date
Filename Promoting Metadata Pipeline Component
This receive pipeline component solves that problem in a clean and reusable way: it reads the incoming filename (ReceivedFileName), splits it using a configured separator character, extracts the value at a configured position, and promotes it into the message context as a promoted property.
What this component is
- ✅ A receive pipeline component
- ✅ Can be used in any stage of a receive pipeline
- It will accept as inputs the separator character, the position to be extracted, the promoted namespace in which the value will be added, and the property name that will be promoted.
- ✅ Uses a separator character to split the filename
- ✅ Promotes a specific token into the message context via property promotion
- ✅ Designed to be reusable across multiple receive locations and naming formats
The pipeline component code
Here’s the core logic:
public Microsoft.BizTalk.Message.Interop.IBaseMessage Execute(
Microsoft.BizTalk.Component.Interop.IPipelineContext pContext,
Microsoft.BizTalk.Message.Interop.IBaseMessage pInMsg)
{
string filename = string.Empty;
bool validFile = true;
string value = "";
try
{
filename = pInMsg.Context.Read(
"ReceivedFileName",
"http://schemas.microsoft.com/BizTalk/2003/file-properties").ToString();
string[] listComments = null;
listComments = filename.Split(Convert.ToChar(this.SplitterChar));
value = listComments[this.Position];
validFile = true;
}
catch
{
validFile = false;
}
if (validFile)
{
pInMsg.Context.Promote(this.PromoteProperty, this.PromoteNamespace, value);
}
return pInMsg;
}
Why this is useful
This is a convenient way to convert file naming conventions into first-class BizTalk metadata—without parsing the payload.
It’s especially helpful when:
- The message is not XML (flat file / EDI / binary)
- The identifier exists only in the filename
- You want consistent routing rules across environments
This receive pipeline component is a simple but powerful pattern: extract a meaningful token from the incoming file name and promote it into the message context so BizTalk can route, track, and correlate messages more intelligently.
What is BizTalk Pipeline Components Extensions Utility Pack?
The BizTalk Pipeline Components Extensions Utility Pack is a set of custom pipeline components (libraries) with several custom pipeline components that can be used in received and sent pipelines, which will provide an extension of BizTalk’s out-of-the-box pipeline capabilities.
The project is available on the BizTalk Server Open Source Community repository on GitHub (https://github.com/BizTalkCommunity), and everyone can contribute new pipeline components that can extend or improve the existing BizTalk Server capabilities.

At the moment, it is only available for BizTalk Server 2020, but it can be easily converted and compiled for earlier versions of the product.
Where to download it?
You can download BizTalk Pipeline Components Extensions Utility Pack from GitHub here:
Hope you find this helpful! If you enjoyed the content or found it useful, and wish to support our efforts to create more, you can contribute to purchasing a Star Wars Lego set for my son!