While working with Salesforce CRM, I was assigned the task of creating a follow-up event for the Opportunity and Campaign records. Instead of creating the events manually, I decided to automate the task creation using the Salesforce flow.
The two approaches I followed to create events using flows are as follows.
- Create Events through actions in Salesforce flows
- Create Events through the Create Record element in Salesforce flows
If you are new to flow, I recommend checking a tutorial on ‘how to create a screen flow in Salesforce.’
Create Events through actions in Salesforce flows
In this example, let’s consider a scenario in which a new opportunity account is created, and an event is assigned to the opportunity’s related Account owner. We will achieve this using a Record-triggered flow, and in that flow, we will add an Action element to create an event for the account owner related to the opportunity record.
To create events through the Action element in Salesforce flows, follow the below steps.
1. Navigate to Salesforce’s setup page, search, and select Flows under Process Automation.
2. In the Flows setup, click on New Flow.
3. Select the option Start from Scratch and click Next. In the next window, select the option Record-Triggered Flow and click on the Create button.

4. According to the scenario, select the Object as Opportunity, then in the Configure trigger, select A record is created.
In this example, setting entry conditions for the record to trigger is optional. I have set a condition that the trigger will run when the Lead Source of the Opportunity records the Web.

5. Create a variable resource for the Start and End fields of the Event. Click on the New Resource button and configure the resource as follows.
- Select the Resource Type as a Variable.
- Enter the API Name as datetime.
- Select the Data Type as date/time, enter the default value, and click Done.

6. Add an Action element to the flow, and select the option Event in the Category.

7. Enter the Label and API name for the Event action, then enter the below fields.
- In the field Assigned ID, select Triggering Opportunity > Account ID > Owner ID.
- In the fields End Date Time and Start Date Time, select the date/time resource we created.

8. In the field Related Record ID, select Triggering Opportunity > Account ID. After this, enter the Subject of the event.

9. Save the flow by entering the Label and Flow API label, then click Save.
10. To activate the flow, click on the Activate button.

The flow is created and activated. After this, we will test the flow.
Test the flow
According to the applied conditions in the flow, create a New Opportunity record.

After creating the Opportunity record, navigate to the Opportunity Account. In the Activity section, you will see the event assigned to the account’s owner.

This way, we can create an event through Action in Salesforce flows by following the above steps.
Create Events through the Create Record element in Salesforce flows
In this example, we will create a Record-trigged flow that will create an Event for the Campaign record when the Campaign Type field is selected as Webinar for the new record or updated for the existing one.
In this example, we will create a record trigger flow using a Create Record element to create an event for the campaign object.
Follow the below steps to create Events through the Create Record element in Salesforce flows.
1. In the flow setup, select the option Record-triggered flow and click Create.
2. In the trigger flow conditions, select the object as Campaign according to the scenario. In the Configure trigger, select When a record is created or updated. You can also set the entry conditions to filter records.

3. Add a get record element to the flow, enter the Label, and select the object Campaign.
In the Conditions requirements, I have added a filter to sort Campaigns with type as Webinar.

4. We need to create a New resource for the Start and End time for the event object. Configure the new resource in the following way.
- Select the Resource Type as a Variable.
- Enter the API Name as datetime.
- Select the Data Type as date/time, enter the default value, and click Done.
5. Add a Create record element and enter the Label. After this, select the Set record Values as Manually and Object as Event.

6. In the section Set Field Values for the Event in the Create record element, map the Fields with the following Values.
| Field | Value |
| OwnerId | Campaign From Get_Campaigns > Owner ID |
| StartDate Time | custom Date/time resource |
| EndDate Time | custom Date/time resource |
| WhatId ( related to) | Campaigns from Get_campaigns > Campaign ID |
| Subject | Enter the subject of Event |

7. Save the record-trigger flow.

8. Activate the flow from the Activate button in the flow builder.

Now, we have created and Activated the flow. In the next steps, we will test the flow.
Test the flow
According to the criteria applied in the trigger conditions, I will update the Campaign Type to Webinar.
As we update the Campaign Type to webinar, the event will be created for the updated campaign.

To view the created Event, click on the Activity tab.

This way, we can create an event using the Creating Record element in the Salesforce Flow.
Conclusion
In Salesforce, automating the process of record creation using Salesforce flows helps streamline data management in the org by saving time from manual record creation.
In the above examples, we discussed the two possible ways to create an Event in Salesforce using the Salesforce record-triggered flow, where we created events for the Account and the Campaign records.
By following the above steps, you might have understood the process of creating Events using the Create record element and Action element in Salesforce flows.
If you want to create the events using the Apex triggers, you can go to the trailhead tutorial Adding Event through Apex trigger.
You may also like to read:
- How to Create a Task Using Flow in Salesforce
- Auto Launched Flow in Salesforce
- Platform Event Triggered Flow in Salesforce
- How to Call Approval Process From Flow in Salesforce
- How to Automate Survey Invitation in Salesforce using Flows?
- How to Create Recurring Task Via Flow in Salesforce

Abhijeet is a skilled Salesforce developer with experience in developing and integrating dashboards, data reports, and Salesforce applications. He is also skilled at optimizing processes and flow automation processes, coding, and executing complex project architecture. Read more about us | LinkedIn Profile.