Action Structure
Action has the following properties:inputSchema– Data Schema describing the payload that will be validated when you run the action.type– action type that maps to a Function Type that implements therunfunction of this action.config– implementation of therunfunction.outputSchema- defines expected output of the action.customOutputSchema- overrides the default value ofoutputSchema. If customOutputSchema is set, outputSchema will always equalcustomOutputSchema
Run Function
Action interface provides one function: Run. The implementation of this function is configured with two properties:type and config.
The run function receives the following arguments:
input- action input provided when running the action.
run function is implemented. If not sure what action type to use, Javascript is the most versatile type that lets you do anything, and API Request to External App is commonly used to configure API requests if it’s all that action needs to do.
| Type | Description | Function Type |
|---|---|---|
run-javascript | Runs custom JavaScript (or TypeScript) code | JavaScript |
api-request-to-external-app | Makes API requests to the external app with authentication applied automatically | API Request to External App |
api-request-to-your-app | Makes API requests to your Internal API | API Request to Your App |
http-request | Makes arbitrary HTTP requests to any endpoint | HTTP Request |
list-data-records | List records in a data collection page by page | List Data Records |
find-data-record-by-id | Find a record in a data collection by ID | Find Data Record By ID |
search-data-record | Search data records by a query string | Search Data Record |
match-data-record | Find a data record with fields matching a query | Match Data Record |
create-data-record | Create a new data record | Create Data Record |
update-data-record | Update an existing data record | Update Data Record |
delete-data-record | Delete a data record by id | Delete Data Record |
Using Actions
Action has only one function:run. To run an action, you need to provide an input that matches its inputSchema. As a result, you will get an output that matches its outputSchema.
All the action runs are recorded as Action Run Logs.
See full API reference here: Actions API Reference.
API Operations
| Operation | Method | Endpoint | Description |
|---|---|---|---|
| List all actions | GET | /actions | Retrieve all workspace actions |
| Get action by ID | GET | /actions/{selector} | Get specific action details |
| Create a new action | POST | /actions | Create a new workspace action |
| Replace action | PUT | /actions/{selector} | Replace action configuration |
| Patch action | PATCH | /actions/{selector} | Update action partially |
| Clone action | POST | /actions/{selector}/clone | Clone an existing action |
| Run action | POST | /actions/{selector}/run | Execute an action |
| Reset action | POST | /actions/{selector}/reset | Reset action to default state |
| Export action | GET | /actions/{selector}/export | Export action configuration |
| Get action dependencies | GET | /actions/{selector}/dependencies | Get action dependencies |
| Restore action | POST | /actions/{selector}/restore | Restore archived action |
| Refresh actions | POST | /actions/refresh | Refresh action definitions |
| Archive action | DELETE | /actions/{selector} | Archive an action |