arazzo: 1.0.1
info:
title: Salesforce Sales Cloud Schedule Event With Contact
summary: Find a Contact by email, then create a calendar Event linked to that Contact.
description: >-
A meeting-scheduling pattern over the Query and SObject Rows resources. The
workflow looks up a Contact by email, branches on whether it was found, and
when matched creates an Event sObject whose WhoId points at the Contact so
the meeting appears on that person's activity timeline. Every step inlines
its request and the OAuth bearer Authorization header.
version: 1.0.0
sourceDescriptions:
- name: queryApi
url: ../openapi/salesforce-sales-cloud-query-api-openapi.yml
type: openapi
- name: sobjectRowsApi
url: ../openapi/salesforce-sales-cloud-sobject-rows-api-openapi.yml
type: openapi
workflows:
- workflowId: schedule-event-with-contact
summary: Locate a Contact by email and schedule an Event with them.
description: >-
Queries for a Contact by email, then creates an Event linked through WhoId
to the matched Contact. Ends without a write when no Contact matches.
inputs:
type: object
required:
- accessToken
- contactEmail
- eventSubject
- startDateTime
- endDateTime
properties:
accessToken:
type: string
description: OAuth 2.0 access token used as the Bearer credential.
contactEmail:
type: string
description: Email of the Contact to match in the SOQL WHERE clause.
eventSubject:
type: string
description: Subject line of the Event to create.
startDateTime:
type: string
description: Event start date-time (ISO 8601).
endDateTime:
type: string
description: Event end date-time (ISO 8601).
location:
type: string
description: Optional meeting location.
steps:
- stepId: findContact
description: Query for the Contact by email.
operationId: $sourceDescriptions.queryApi.executeSOQLQuery
parameters:
- name: Authorization
in: header
value: Bearer $inputs.accessToken
- name: q
in: query
value: "SELECT Id FROM Contact WHERE Email = '$inputs.contactEmail' LIMIT 1"
successCriteria:
- condition: $statusCode == 200
outputs:
totalSize: $response.body#/totalSize
contactId: $response.body#/records/0/Id
onSuccess:
- name: contactFound
type: goto
stepId: createEvent
criteria:
- condition: $response.body#/totalSize > 0
- name: contactMissing
type: end
criteria:
- condition: $response.body#/totalSize == 0
- stepId: createEvent
description: Create the Event linked to the matched Contact via WhoId.
operationId: $sourceDescriptions.sobjectRowsApi.createSObjectRecord
parameters:
- name: Authorization
in: header
value: Bearer $inputs.accessToken
- name: sObjectName
in: path
value: Event
requestBody:
contentType: application/json
payload:
Subject: $inputs.eventSubject
StartDateTime: $inputs.startDateTime
EndDateTime: $inputs.endDateTime
Location: $inputs.location
WhoId: $steps.findContact.outputs.contactId
successCriteria:
- condition: $statusCode == 201
outputs:
eventId: $response.body#/id
outputs:
contactId: $steps.findContact.outputs.contactId
eventId: $steps.createEvent.outputs.eventId
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Get an API key
Free tier, no form to fill in. Signing in shares your email address with us — we
store it to create your key and to recognise you if you sign in with another
provider. By signing up you are subscribing to the APIs.io and API Evangelist
newsletters — you can unsubscribe from any issue. See our
Privacy Policy and Terms.