Pragmatic Works Nerd News

Azure Synapse Analytics: Until Activity [Introduction to Synapse - Ep. 15] - Check if File Exists!

Written by Mitchell Pearson | Sep 16, 2026

In this tutorial, Mitchell Pearson from Pragmatic Works introduces the concept of the "Until" activity within Azure Synapse Analytics. This powerful tool allows you to automate processes in your pipelines by waiting for specific conditions to be met. Specifically, Mitchell demonstrates how to configure a pipeline that waits until a file exists in a data lake before processing it.

 

What Are Variables and Parameters?

Before diving into the Until activity, it's important to understand the role of variables and parameters in Azure Synapse Analytics. While they may seem similar, they serve different purposes:

  • Parameters: Allow for passing external values into a pipeline, making it more configurable and reusable.
  • Variables: Used inside the pipeline to store values that can be updated during execution, particularly useful for loops and conditional checks.

Creating the Pipeline and Setting Up the Variable

Mitchell begins by creating a new pipeline and adding a variable to monitor the presence of a file. This variable is set to a Boolean type, which will evaluate to either true or false depending on whether the file exists in the specified location.

  • Variable Name: fileExist
  • Default Value: false

He explains that the variable will be used in conjunction with the Until activity to check for the file’s existence. If the file does not exist, the pipeline will continue to run and check again.

Adding the Until Activity

Next, Mitchell adds the Until activity to the pipeline. This activity evaluates a condition until it evaluates to true, at which point the pipeline moves on to the next set of operations. The Until activity is set to evaluate the fileExist variable, which is initially set to false.

He then configures the activity to perform the following steps:

  1. Check for File Existence: A "Get Metadata" activity is added to check whether the target file exists in the specified data lake location.
  2. Update the Variable: If the file exists, the variable is updated to true, causing the Until activity to stop.
  3. Wait Activity: A small delay is added to avoid checking too frequently, which would strain resources.

Handling the File Existence Check

Mitchell demonstrates the configuration of the "Get Metadata" activity. This activity is set to check a folder within the data lake for a file called holiday.csv. If the file exists, the output will be true, indicating that the condition for the Until activity is met.

Running the Pipeline

After setting up the Until activity and connecting it with the necessary activities, Mitchell runs the pipeline in debug mode. The process begins by checking the variable, which is false, and then runs the "Get Metadata" activity. Since the file does not exist initially, the variable remains false, and the Until activity continues to loop.

Once the file is uploaded into the data lake, the pipeline detects its existence, and the variable is updated to true. This action causes the Until activity to stop, and the pipeline can proceed with subsequent steps.

Key Takeaways

Mitchell concludes the tutorial by highlighting the main steps and the practical use cases for the Until activity in Azure Synapse Analytics. The ability to automate waiting for files to arrive in a data lake streamlines data workflows and ensures that processes only continue when the necessary data is available. Here's a summary of key points:

  • Use Variables: Variables in Synapse Analytics help manage values that can change during pipeline execution, particularly for looping and waiting.
  • Implement the Until Activity: This activity allows the pipeline to pause until a condition is met, such as the existence of a file.
  • Optimize with Wait Activity: Avoid overloading resources by adding a small delay between checks.

Mitchell's explanation provides valuable insights into automating data workflows in Azure Synapse Analytics and can be a great addition to any developer’s toolkit for working with data pipelines.

Conclusion

By the end of this tutorial, users should have a solid understanding of how to configure the Until activity in Azure Synapse Analytics and apply it to automate processes, ensuring that operations occur only when specific conditions are met, such as file availability.

Don't forget to check out the Pragmatic Works' on-demand learning platform for more insightful content and training sessions on Azure Synapse and other Microsoft applications. Be sure to subscribe to the Pragmatic Works YouTube channel to stay up-to-date on the latest tips and tricks.