No Data/Agent Cloud Required.

100% Salesforce Native

No Data/Agent Cloud. 100% Salesforce Native

Prompt Action Framework

Picture of Kalanithi Balasubramanian

Kalanithi Balasubramanian

Updated on May 1, 2025

The Prompt Action Framework in GPTfy allows you to automate actions directly from a prompt run.

These actions are configured per prompt and defined in the Actions Tab during prompt setup.

Adding Actions

  • Locate the Actions Tab: Open or create a prompt and navigate to the Actions Tab.

  • Add Actions: Click the plus (+) icon to open a dropdown of available action types.

  • Configure Actions: Each action type has a dedicated configuration window.

Available Actions

  • One can’t create, update, or delete an action when the prompt is activated.

1. Update Field

This action updates a field on the record where the prompt is run with that particular AI response.

Steps to Configure:

  • Select Update Field from the dropdown.
  • Configure the following in the pop-up window:
    • Action Type: Displays the selected action (modifiable).
    • Description: Add a description of the action.
    • Sequence: Define the execution order among multiple actions.
    • AI Response: Specify the AI-generated value to update.
      For JSON prompts, individual nodes of the JSON can be used.
    • Field: Select the field to be updated.
    • Append Timestamp: Enable this checkbox to append a timestamp for audit purposes.

2. Create Record

This action allows the creation of a new record for a specified object.

Steps to Configure:

  • Select Create Record from the dropdown.
  • Configure the following in the pop-up window:
    • Action Type: Displays the selected action (modifiable).
    • Description: Add a description of the action.
    • Sequence: Define the execution order among multiple actions.
    • Object: Select the target object for the new record.
    • Field Mapping: Specify field values:
      • Hardcoded: Manual entry of fixed values.
      • Reference Field: Map values from fields on the current record.
      • AI Response: Use AI-generated values to support JSON components for JSON prompts.
    • Add/Remove Fields: Use the Add Row or delete icon to manage field mappings.

3. Invoke Flow

This action triggers a Salesforce Flow.

Steps to Configure:

  • Select Invoke Flow from the dropdown.
  • Configure the following in the pop-up window:
    • Action Type: Displays the selected action (modifiable).
    • Description: Add a description of the action.
    • Sequence: Define the execution order among multiple actions.
    • Flow: Provide the API name of the Flow to invoke.

4. Invoke Apex

This action executes a Salesforce Apex class.

Steps to Configure:

  • Select Invoke Apex from the dropdown.
  • Configure the following in the pop-up window:
    • Action Type: Displays the selected action (modifiable).
    • Description: Add a description of the action.
    • Sequence: Define the execution order among multiple actions.
    • Apex Class: Enter the API name of the Apex class.

5. Open a Form

This action opens a pre-configured form for data entry or updates.

Steps to Configure:

  • Select Open a Form from the dropdown.
  • Configure the following in the pop-up window:
    • Action Type: Displays the selected action (modifiable).
    • Description: Add a description of the action.
    • Sequence: Define the execution order among multiple actions.
    • Object: Select the target object for the form.
    • Field Mapping: Specify field values using:
      • Hardcoded: Manual entry of fixed values.
      • Reference Field: Map values from fields on the current record.
      • AI Response: Use AI-generated values.
    • Add/Remove Fields: Manage fields with the Add Row or delete icon.
  • Once the prompt is run, an Open a Form button appears in the expanded view on the GPTfy console.
  • When a prompt is run, actions execute in the specified sequence.
  • For “Open a Form,” the number of forms displayed corresponds to the number of ‘Open a form’ actions configured.
  • If record types are specified, they will be included automatically, and mapped values will be pre-filled.

Prompt Action Validations

Validation now ensures that only valid objects, fields, flows, and classes are used at the time of prompt activation, reducing errors at runtime.

Action Validation
Flow Action
Must reference an Active Auto-Launched Flow. SOQL Check: SELECT Id, ApiName, NamespacePrefix FROM FlowDefinitionView WHERE IsActive = True AND ProcessType = ‘AutoLaunchedFlow’

Apex Class

 

Apex class must exist in the org.
Activation error is shown if missing.

 

Update Field

Selected field must be valid.
If using a prompt component, it must exist.
Missing fields or components trigger an activation error.

Create Record

 

Selected object must exist.
Field mapping must be populated.
Each field in mapping must exist.
Referenced fields must exist.
Prompt component mapping must reference existing components.

Open a Form
Same validation as Create Record. Object and fields must exist and be correctly mapped.

Example Test Scenarios

  • Flow: Add an inactive flow or non-Auto-Launched flow → Activation should fail.

  • Apex Class: Reference a non-existent Apex class → Activation should fail.

  • Update Field: Remove a mapped field or FLS access → Activation should fail.

  • Create Record: Delete the object or a mapped field → Activation should fail.

  • Open a Form: Delete the object or a mapped field → Activation should fail.

Post-Run: Prompt Action Details in Security Audit

After a prompt is run:

  • All prompt actions and their execution statuses are automatically logged in the Security Audit under the Prompt Actions tab.

  • For each action, the audit captures:

  • Action Type (e.g., Update Field, Create Record)

  • Current Status (Success, Error)

  • Error Message (if any during execution)

  • Linked to the Security Audit Record for traceability

This allows you to easily review which actions succeeded or failed during prompt execution, enhancing compliance and operational transparency.

Activation Behavior

When you activate a prompt:

  • GPTfy validates all configured actions.

  • If any validation fails, the prompt activation is blocked with a clear error message.

  • Once validated, the actions execute sequentially when the prompt runs.
GPTfy
Privacy Overview

This website uses cookies to provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognizing you when you return to our website and helping our team understand which sections of the website you find most interesting and useful.