How to Publish and Obtain an Existing WDL Workflow in Visual Studio Code
In this section, we will focus on the process of publishing your Workflow Definition Language (WDL) workflow from Visual Studio Code to Azure Logic Apps. Additionally, we’ll cover how to retrieve an existing workflow from Azure Logic Apps if you need to modify or troubleshoot a pre-existing WDL workflow.
Step 1: Publishing a WDL Workflow to Azure Logic Apps
Once you’ve created your WDL-based workflow in Visual Studio Code, you need to publish it to Azure Logic Apps to execute it in the cloud. Here’s how to do it:
- Open the Command Palette:
- In Visual Studio Code, press
Ctrl + Shift + Pto open the Command Palette.
- Create Azure Logic App:
- If you haven’t already created a Logic App in Azure, you can do so by selecting “Logic App: Create Logic App (Standard) project“.
- Follow the prompts to create a new Logic App by selecting your Azure subscription and resource group.
- Right-Click Deployment:
- Once your workflow is ready in
workflow.json, right-click the folder containing your project files in the Visual Studio Code explorer. - Choose Deploy to Logic App.
- Select Resource Group and Logic App:
- If you already have a Logic App created, Visual Studio Code will prompt you to select an existing resource group and Logic App where you want to deploy the workflow.
- After selecting, the workflow is deployed and ready to be triggered in Azure.
- Monitoring the Deployment:
- You can monitor the deployment process in the Output window in Visual Studio Code.
- If the deployment is successful, your workflow will be published and ready for execution within Azure Logic Apps.
Step 2: Obtaining and Editing an Existing WDL Workflow
If you have an existing WDL workflow already deployed in Azure Logic Apps and need to retrieve it for editing or debugging, Visual Studio Code allows you to easily pull it down for local development.
Here’s how to retrieve an existing Logic App workflow:
- Connect Visual Studio Code to Azure:
- Ensure you are signed in to your Azure account in Visual Studio Code by using the Azure Tools extension. You can sign in via the Azure sidebar.
- Open the Logic Apps Extension:
- From the left-hand sidebar, click on the Azure icon.
- Navigate to Logic Apps in your Azure subscription.
- Find Your Logic App:
- Browse through the resource groups and subscriptions until you find the Logic App where your WDL workflow is deployed.
- Download the Logic App Definition:
- Right-click on the Logic App and select Download Workflow Definition.
- Visual Studio Code will download the current
workflow.jsondefinition of your Logic App, which you can now edit locally.
- Edit the Workflow:
- Make changes to the
workflow.jsonas needed. - After making your changes, you can deploy the updated workflow back to Azure Logic Apps by following the steps in Step 1.
Monitoring and Testing Published Workflows
After publishing your workflow, you can manage and monitor it directly from the Azure Portal or Visual Studio Code.
- Testing in the Azure Portal:
- Open the Azure Portal and navigate to the Logic Apps resource where your workflow is deployed.
- Under the Runs History section, you can view detailed logs for each execution, including whether the workflow succeeded or failed and where in the process it failed.
- Triggering Manually:
- You can trigger the Logic App manually from both the Azure Portal or Visual Studio Code.
- Right-click on the Logic App in Visual Studio Code and select Run Logic App to manually trigger it.
- Real-time Debugging:
- If the workflow encounters any issues, you can view the error logs and details in the Azure Portal’s Monitoring section or Visual Studio Code’s Output window.
Expanded Command Comparison Table: Python vs WDL
Here’s the updated and expanded command comparison table:
| Feature/Command | Python | WDL (Workflow Definition Language) |
|---|---|---|
| Conditionals | if condition: ... else: | @greater, @equals expressions in Condition |
| Loops | for item in list: | Apply to each action |
| Variable Initialization | variable = value | Initialize/Set Variable actions |
| Functions | def function(): | Group of actions; reusable in scope but not across workflows |
| API Calls | requests.get/post('url') | HTTP action for GET/POST requests |
| Expressions | x + y, substring(), math | WDL Expressions (add, concat, substring) |
| Date/Time Handling | datetime.now() | utcNow(), addDays() |
| Flow Control | break, continue, return | Conditions inside loops, Terminate action |
| SharePoint Integration | Use SharePlum library for SharePoint | HTTP requests to SharePoint REST API for CRUD operations |
| Parallel Processing | threading or asyncio libraries | Parallel Branches action in Logic Apps |
| Error Handling | try-except block | Scope action with success/failure conditions |
| Logging | print(), logging module | Write to log action |
| File Manipulation | open(), with open() | Use File action to manipulate files in Logic Apps |
| Parallel Branches | Multithreading, multiprocessing | Parallel Branches action to handle parallel executions |
Useful Links
Below are links to Microsoft’s official documentation, which can help you learn more about Workflow Definition Language (WDL) and deploying Logic Apps.
- Workflow Definition Language (WDL) in Logic Apps
- Azure Logic Apps Documentation
- HTTP Action in Logic Apps
- Using Azure Logic Apps in Visual Studio Code
- SharePoint REST API Documentation
Conclusion
Using WDL in Visual Studio Code to create, publish, and manage workflows gives you a powerful environment for building scalable automations. In this guide, we covered how to develop and publish a workflow that reads from a SharePoint list and copies items based on a price condition.
Additionally, with the ability to retrieve existing workflows, you can easily manage and troubleshoot Logic Apps workflows directly from Visual Studio Code, allowing for more streamlined development and maintenance processes.

Leave a comment