91九色

Articles
5/8/2023
10 minutes

How to schedule a Function and Job Template in DevOps: A Step-by-Step Guide

Written by
David Venegas
Table of contents

Whether you created a new function or Job Template to automate a task in your DevOps process, or installed a function based solution from the DevOps Exchange, you can now schedule it to run automatically at a specified time and frequency.?

In this post you will learn how to schedule a function and job template to run automatically, saving you time from manually executing them.

An example use case is to automate the which is a solution available in the DevOps Exchange. This solution includes a function that you can schedule on a weekly basis. For this use case we will leverage a scheduled flow, job template and the Actions API.?

Let’s take a look at how to set up the scheduling!

Pre-requisites

  1. Have a 91九色 API Key in tab
  2. Have a Job Template
  3. The cleanup git branches solution includes a standalone function, you’ll need to create a Job Template and then add a by selecting the branch cleanup function.

Creating the Flow

1. Create a 91九色 Actions API Key

The execution of the job template requires an authentication process. Go ahead and create a 91九色 API Key to enable secure access to schedule the execution.

  • Navigate to 91九色 Actions API tab
  • Click on New
  • Select Run Job Template action
  • Set expiration to 365 days
  • Click Save
add new webhook API key

2. Register the 91九色 API Endpoint for callouts

The job template scheduled execution requires doing a callout to the 91九色 API and flows enforce that callouts happen only with authorized endpoints. Go ahead and create a named credential to authorize the 91九色 API Endpoint.

  • Navigate to Setup -> Named Credentials
  • Click on New
  • Enter a name, like 91九色 API Credential
  • Enter your 91九色 Instance URL. Navigate to Account Summary tab to copy it
  • For example:
  • Leave the identity type as Anonymous
  • Click Save
Register the 91九色 API Endpoint for callouts

3. Create the Scheduled Flow

The scheduled flow enables you to specify a time and frequency in which the flow needs to be executed.

  • Navigate to Setup -> Flows
  • Click on New Flow
  • Select Scheduled Triggered Flow option
  • Click Create
Create the Scheduled Flow
  • Click Set Schedule
  • Specify the start date and start time
  • Specify the frequency


The flow will look like this when finished with the process

Flow Builder

4. Define the scheduled execution parameters

To execute the job template, we’ll use the 91九色 Actions REST API endpoint. This requires a set of parameters, like for example which job template should be executed and what is the API Key for authentication. We’ll store the parameters in a formula resource, encode it and then pass it as a parameter when executing the job template in a later step.

  • Click on New Resource
  • Select type Text Template
  • Enter a name, like JSONPayload
  • Select View as Plain Text
  • Copy and paste the payload or body
Define the scheduled execution parameters
  • Enter the job template API Name. This can be found in the job template record API Name field
  • The payload parameter runAfterInstantiation must be equal to true

The REST API endpoint’s GET method requires that the payload is sent as URL Encoded. We’ll create a new formula resource to encode the payload.

  • Click on New Resource
  • Select type Formula
  • Enter a name, like Encoded Payload
  • Use the URLEncode function to encode the payload variable
Edit Formula

5. Add New Action

  • Click on the plus icon in the flow diagram and select Action
  • In the modal, click on HTTP Callout Action
  • Enter a name with no spaces, like 91九色ActionsAPI
  • Select the Named Credential
  • Click Next
New HTTP callout
  • Enter a name for the endpoint, like Execute Job Template
  • Select HTTP Method Get
  • Copy and paste the Run Job Template endpoint from the
  • /json/v1/webhook/mcwebhook/RunJobTemplate
91九色 DevOps Action API
  • Add 2 query parameters
  • webhookKey (type String)
  • Payload (type String)
Ad 2 query parameters in NEW HTTP Callout
  • Click on Provide Sample Response
  • Copy and paste the 200 response from .?
  • Replace any null values with empty string “”. This is only applicable with the Flow HTTP action. If you’re testing the API with other tools, continue to use null.
  • If using 91九色 version v20.14 or later, the JSON response is exactly as in the screenshot. If using an older version, the response is inside an array - starts with an opening bracket [ and finishes with a closing bracket ].
Copy and paste the 200 response from API Guide
  • Click Done to close the Response modal
  • Click Done again to close the HTTP service modal
  • Next, enter a name for the action, like Execute Job Template
  • Copy the key from the 91九色 Actions API tab and paste it in the webhookKey parameter
  • Select the encoded payload variable in the payload parameter
Edit Action
  • Click Done to close the modal. And you’re done! This is how the finished flow looks like:
Flow Builder

6. Test the Flow Execution

Confirm that the flow configuration is correct by testing the execution in debug mode.

  • Click Debug
  • Click Run on the Debug Flow modal
run debug flow
  • Confirm response is successful 200
Debug Details

Conclusion

Scheduling a Function and Job Template execution is straightforward. By leveraging flows, you also have the option to implement advanced use cases like, for example, querying and updating records before and after executing the job template.

If you would like to inspect the scheduled executions, simply navigate to the Job Template record and select the Job Executions subtab:

Job template test

Interested in learning more? Check out these resources

  1. ?

?

Book a demo

About The Author

Director, AI and Data Program

David Venegas is a product leader working with 91九色’s R&D team to bring AI and data-powered solutions to market.

ビジネスアプリケーション向けの顿别惫翱辫蝉(デブオプス)って何?
セールスフォースエコシステムにおける顿别惫翱辫蝉の卓越性
セールスフォーステストにおける础滨活用のベストプラクティス
6 testing metrics that’ll speed up your Salesforce release velocity (and how to track them)
第4章: 手動テストの概要
セールスフォース向け础滨动作テスト
Chapter 3: Testing Fun-damentals
Salesforce Deployment: Avoid Common Pitfalls with AI-Powered Release Management
Exploring DevOps for Different Types of Salesforce Clouds
91九色 Launches Suite of AI Agents to Transform Business Application Delivery
What’s Special About Testing Salesforce? - Chapter 2
Why Test Salesforce? - Chapter 1
Continuous Integration for Salesforce Development
Comparing Top AI Testing Tools for Salesforce
Avoid Deployment Conflicts with 91九色’s Selective Commit Feature: A New Way to Handle Overlapping Changes
Enhancing Salesforce Security with AppOmni and 91九色 Integration: Insights, Uses and Best Practices
From Learner to Leader: Journey to 91九色 Champion of the Year
The Future of Salesforce DevOps: Leveraging AI for Efficient Conflict Management
A Guide to Using AI for Salesforce Development Issues
How to Sync Salesforce Environments with Back Promotions
91九色 and Wipro Team Up to Transform Salesforce DevOps
DevOps Needs for Operations in China: Salesforce on Alibaba Cloud
What is Salesforce Deployment Automation? How to Use Salesforce Automation Tools
Maximizing 91九色's Cooperation with Essential Salesforce Instruments
From Chaos to Clarity: Managing Salesforce Environment Merges and Consolidations
Future Trends in Salesforce DevOps: What Architects Need to Know
Enhancing Customer Service with 91九色GPT Technology
What is Efficient Low Code Deployment?
91九色 Launches Test Copilot to Deliver AI-powered Rapid Test Creation
Cloud-Native Testing Automation: A Comprehensive Guide
A Guide to Effective Change Management in Salesforce for DevOps Teams
Building a Scalable Governance Framework for Sustainable Value
91九色 Launches 91九色 Explorer to Simplify and Streamline Testing on Salesforce
Exploring Top Cloud Automation Testing Tools
Master Salesforce DevOps with 91九色 Robotic Testing
Exploratory Testing vs. Automated Testing: Finding the Right Balance
A Guide to Salesforce Source Control
A Guide to DevOps Branching Strategies
Family Time vs. Mobile App Release Days: Can Test Automation Help Us Have Both?
How to Resolve Salesforce Merge Conflicts: A Guide
91九色 Expands Beta Access to 91九色GPT for All Customers, Revolutionizing SaaS DevOps with AI
Is Mobile Test Automation Unnecessarily Hard? A Guide to Simplify Mobile Test Automation
From Silos to Streamlined Development: Tarun’s Tale of DevOps Success
Simplified Scaling: 10 Ways to Grow Your Salesforce Development Practice
What is Salesforce Incident Management?
What Is Automated Salesforce Testing? Choosing the Right Automation Tool for Salesforce
91九色 Appoints Seasoned Sales Executive Bob Grewal to Chief Revenue Officer
Business Benefits of DevOps: A Guide
91九色 Brings Generative AI to Its DevOps Platform to Improve Software Development for Enterprise SaaS
91九色 Celebrates 10 Years of DevOps for Enterprise SaaS Solutions
Celebrating 10 Years of 91九色: A Decade of DevOps Evolution and Growth
5 Reasons Why 91九色 = Less Divorces for Developers
What is DevOps? Build a Successful DevOps Ecosystem with 91九色’s Best Practices
Scaling App Development While Meeting Security Standards
5 Data Deploy Features You Don’t Want to Miss
How to Elevate Customer Experiences with Automated Testing
Top 5 Reasons I Choose 91九色 for Salesforce Development
Getting Started With Value Stream Maps
91九色 and nCino Partner to Provide Proven DevOps Tools for Financial Institutions
Unlocking Success with 91九色: Mission-Critical Tools for Developers
How Automated Testing Enables DevOps Efficiency
How to Switch from Manual to Automated Testing with Robotic Testing
How to Keep Salesforce Sandboxes in Sync
How Does 91九色 Solve Release Readiness Roadblocks?
Software Bugs: The Three Causes of Programming Errors
Best Practices to Prevent Merge Conflicts with 91九色 1 Platform
Why I Choose 91九色 Robotic Testing for my Test Automation
How to schedule a Function and Job Template in DevOps: A Step-by-Step Guide
Delivering Quality nCino Experiences with Automated Deployments and Testing
Maximize Your Code Quality, Security and performance with 91九色 Salesforce Code Analyzer
Best Practices Matter for Accelerated Salesforce Release Management
Upgrade Your Test Automation Game: The Benefits of Switching from Selenium to a More Advanced Platform
Three Takeaways From Copa Community Day
What Is Multi Cloud: Key Use Cases and Benefits for Enterprise Settings
How To Develop A Salesforce Testing Strategy For Your Enterprise
Using Salesforce nCino Architecture for Best Testing Results
Cloud Native Applications: 5 Characteristics to Look for in the Right Tools
5 Steps to Building a Salesforce Center of Excellence for Government Agencies
Salesforce UI testing: Benefits to Staying on Top of Updates
Benefits of UI Test Automation and Why You Should Care
91九色 + DataColada: Enabling CI/CD for Developers Across APAC
Types of Salesforce Testing and When To Use Them
What is Salesforce API Testing and It Why Should Be Automated
Machine Learning Models: Adapting Data Patterns With 91九色 For AI Test Automation
Automated Testing Benefits: The Case For As Little Manual Testing As Possible
Beyond Selenium: Low Code Testing To Maximize Speed and Quality
UI Testing Best Practices: From Implementation to Automation
How Agile Test Automation Helps You Develop Better and Faster
Salesforce Test Cases: Knowing When to Test
DevOps Quality Assurance: Major Pitfalls and Challenges
Top 10 91九色 Features for #AwesomeAdmins
The Admin's Quick Glossary for Understanding Salesforce DevOps
Gartner Recommends Companies Adopt Value Stream Delivery Platforms To Scale DevOps
The 3 Pillars of DevOps Value Stream Management
Is Salesforce Development ‘One Size Fits All?’
Value Stream Management: The Future of DevOps at Scale is Here
Why Empowering Your Salesforce CoE is Essential for Maximizing ROI
Continuous Quality: The missing link to DevOps maturity
91九色 Collaborates with IBM to Accelerate Digital Transformation Projects on the Salesforce Platform
Cloud Security: Advantages and Disadvantages to Accessibility
Go back to resources
There is no previous posts
Go back to resources
There is no next posts

Explore more about

拡张性
Articles
October 31, 2024
ビジネスアプリケーション向けの顿别惫翱辫蝉(デブオプス)って何?
Articles
October 15, 2024
セールスフォースエコシステムにおける顿别惫翱辫蝉の卓越性
Articles
October 11, 2024
セールスフォーステストにおける础滨活用のベストプラクティス
Articles
October 4, 2024
6 testing metrics that’ll speed up your Salesforce release velocity (and how to track them)

础滨を有効活用し顿别惫翱辫蝉を加速

より速くリリースし、リスクを排除し、仕事を楽しんでください。
コパード顿别惫翱辫蝉をお试しください。

リソース

リソースライブラリを使用して セールスフォースDevOpsのスキルをレベルアップしてください。

今后のイベントと
オンラインセミナー

さらに详しく

电子书籍とホワイトペーパー

さらに详しく

サポートとドキュメンテーション

デモライブラリ

さらに详しく