In Salesforce, flows help us automate users’ tasks and activities, which results in efficiency in managing them in the organization.
In this tutorial, we will learn how to create a Task Using Flow in Salesforce with real-time scenarios and explanations.
Task Using Flow in Salesforce
What is the use of a task in Salesforce Flow?
In Salesforce, we can use a flow to automate the process of creating tasks for a particular record. The task created with a record trigger flow will notify the user of the task details to work on it. Here, we will learn how to create a task using a flow in Salesforce.
We can create a task using the following two methods:
- Using Action Element: Here, we will get a predefined task object field to map with the Account fields.
- Using Create Record Element: Here, we need to specify task fields and map them to the account fields.
Limitations for using Action Element:
- Using the action element, we can add only a few fields in task records that are predefined in Salesforce Flow.
- We can add extra fields to the Create Record element that we cannot add to the Action element.
Scenario:
While working as a Salesforce Admin for a US-based Organization that provides software solutions, I was assigned the task of creating a task that, whenever an Account is created with revenue more than 1 lakh, we need to notify the user that this is a high-potential client, and you need to follow up with the primary contact for that particular Account.
Pre-requisite: We need a lookup relationship field on an Account object related to the Contact object with the Primary Account field name.
How to Create a Task Using Flow in Salesforce
Using the above scenario and the following steps, we can create a task using Salesforce Flow.
Create Task Using Action Element:
First, we will see how to create a task using an action element in Salesforce Flow.
1. Log in to the Salesforce Org. -> Click on the Setup -> Home Tab -> In Quick Find Box, Search for Flows. You will see an option under Process Automation -> Click on Flows.

2. Then, click on the New Flow button to create a new flow.

3. The task will be created when the Account record is created. For that, we have to select the Record-Trigger flow. Then, click on the Create button.

4. In our scenario, the flow should trigger when we create an Account record. That’s why I have selected the Account in the Object field. In Configure Trigger, I have selected A Record is Created because when we create the record, the flow should trigger.

5. Then, we have to Set Entry Conditions, and in the Condition Requirement option, we have to select All Conditions Are Met(AND) because following both conditions should meet the criteria.
Here, the flow has to trigger only when the AnnualRevenue is> 100000 and the Primary Contact field is not Null.

6. Then we need to select Every time a record is updated and meets the condition requirements: When you select this option, every time you update the record, the flow will trigger.
We are going to create a related record and want to link that record to the Account and Contact, so we have to select Optimize the Flow for Action and Related Records.

7. Now, we are creating the task using Action Element. To add an action element, click on the + plus icon, and then you will see the Action Element. Then click on the All category.
As you click on it, you need to add an action in the Action field. To create a task, we have to select the New Task action. Then, enter the Label, and the API Name will automatically populate. The description is optional; you can give a short intro about this Action element.

8. We have to Set Field Values for the Selected Action. The following input values will display on the Task object as fields on the Detail Page.
- Assigned to ID: In this field, we can assign a user to the created Task record. Here, I have assigned the same user as the owner of the Account object Record.
- Due Date Only: I have created the formula variable for the next day and used that formula here.
- Name ID: If we need to relate a task record with a contact or lead object, then we need to provide a Name ID. Here, I have related task records to the Primary Contact.
- Related Record ID: Here, we can relate the task record to the parent record.
- Subject: Then I have entered a hardcore subject, which will display on the Task activity.
After that, click on the Done button.

9. After that, first save the flow. You can see the Save button. Click on it and then click on the Debug button. Then click on the Activate button; always remember to debug the flow before activating it. It’s good practice to use flow.

10. After that, I created an Account with more than 1 Lakh revenue and saved that record. As I saved the Account record, the flow triggered, and a Task was created with the details that we had entered in Set Field Values for the Selected Action.

This is how we can create a task using an Action Element in Salesforce Flow.
Create Task Using Create Record Element:
Now we will see, using the create record element, how to create a task in the Salesforce Flow.
1. The Create Record element we will add to an existing flow that we have created for the Action element.
Now, we are going to create a task using the Create Record Element. To do that, click on the Add Element icon. Under the Data component, you can see Create Record. Click on it.

2. When we click on Create Records, we enter the Label, which will display on the flow canvas. The API Name will automatically populate. The description is optional.
Then, we will create only one record at a time, using Separate resources and literal values because we will not use all values to create a Task record.

3. Now, we have Set Values for the Task. We need to assign values to the task object just like we have assigned in the Action element, but you will notice that we have more fields here than in the Action element. This is the advantage of the Create Record element.
Here, on the left side, we can see the Task object Fields, and on the right side are the Values that we will provide from the Account object or other resources. The following input values will display on the Task object as fields on the Detail Page.
- OwnerID: We have assigned the Account Owner ID to this field because I have assigned the Account Owner to the Task record owner.
- ActivityDate: This is the due date that this task should be completed before the Due date.
- WhoID: The Who ID basically refers to the person, such as the lead or contact. Here, we have a lookup relationship with the Primary Contact, so we have assigned this to the Who ID.
- WhatID: What id refers to other than a person, so here we have assigned the parent record of the Task object.
- Subject: Then I have entered a hardcore subject, which will display on the Task activity.
- Description: Here, we can write any message as a description.
- Priority: We can set default Priority from the set field value.

4. After setting up all labels and conditions, click the Save button to save the flow. For that, we need to enter the Flow Label; here, I have entered the create a task using flow. The API Name will automatically populate as we click the text box. The Description is optional; we can introduce our flow shortly.

5. We added the Create Record element to the same Action element flow and Activated it. Now, we will check how it will work in the Account Record and how we will create the Task Records.

6. Here, you can see that I created an Account record with the triggering conditions, and when the flow is triggered, the two tasks are created: the first from the Action Element and the second from the Create Record Element.
Here, you can see on the second task we have a Red Flag. This will be possible from the create record element. We cannot use this in the action element. Now, I will show you the Task Details record that we have created from the Create record element.

7. Here, you can see we have extra fields with comments as Description rather than the Action element.

This is how we can create a task using a Create Record element in Salesforce Flow.
Conclusion
In this article, we have learned about Tasks and activities. I hope you have an idea of how to create a task using Flow in Salesforce.
Here, we have seen what a task is, different methods for creating a task in Salesforce flow, its limitations, and how to create a task using a Salesforce flow with a scenario and step-by-step explanation.
You may like to read:
- How to Update Related Records using Salesforce Flow
- How to Upload Files Using Screen Flow in Salesforce
- How to Add Record Type in Salesforce Flow
- How to Delete Records using Flow in Salesforce
- How to Send Custom Notification using Flow in Salesforce
- How to Create Recurring Task Via Flow in Salesforce
- Assign Tasks in Salesforce Using Apex
I am Bijay Kumar, the founder of SalesforceFAQs.com. Having over 10 years of experience working in salesforce technologies for clients across the world (Canada, Australia, United States, United Kingdom, New Zealand, etc.). I am a certified salesforce administrator and expert with experience in developing salesforce applications and projects. My goal is to make it easy for people to learn and use salesforce technologies by providing simple and easy-to-understand solutions. Check out the complete profile on About us.