API Stability Long-Term

The createActionFromTemplate() GraphQL mutation is used to create an action from a yaml template.

For more information on creating an action, see the Actions documentation page.

Syntax

Below is the syntax for the createActionFromTemplate() mutation field:

graphql
createActionFromTemplate(
      input: CreateActionFromTemplateInput!
   ): Action!

For the given datatype, you'll have to provide the yamlTemplate parameter with a YAML template within quotes. That can be complicated. You might try copying one from a package template for a starting point, and then edit it to your needs. See createActionFromPackageTemplate() .

Below is an example of how this mutation field might be used:

Show:
graphql
mutation {
  createActionFromTemplate(input:
        {viewName: "humio", 
         name: "test-action", 
         yamlTemplate: "name: Actor\nmethod: POST ... " } )
  { id, name, isAllowedToRun }
}
Example Responses
Show:
json
{
  "data": {
    "createActionFromTemplate": {
      "id": "2zLdPUtUOtvi7htJTqNavETrnkODcz86",
      "name": "test-action",
      "isAllowedToRun": true
    }
  }
}

Given Datatypes

For CreateActionFromTemplateInput, there are a few parameters. Below is a list of them:

Table: CreateActionFromTemplateInput

ParameterTypeRequiredDefaultStabilityDescription
Some arguments may be required, as indicated in the Required column. For some fields, this column indicates that a result will always be returned for this column.
Table last updated: Sep 17, 2024
namestringyes Long-TermThe name of the action.
viewNamestringyes Long-TermThe name of the view of the action.
yamlTemplateyamlyes Long-TermA template that can be used to recreate the action.

Returned Datatypes

The returned interface action has its own parameters. Below is a list of them along with their datatypes and a description of each:

Table: Action

ParameterTypeRequiredDefaultStabilityDescription
Some arguments may be required, as indicated in the Required column. For some fields, this column indicates that a result will always be returned for this column.
Table last updated: Mar 17, 2025
allowedActions[AssetAction]yes PreviewA list of allowed asset actions. See AssetAction.
displayNamestringyes Long-TermThe display name of the action.
idstringyes Long-TermThe unique identifier of the action.
isAllowedToRunbooleanyes Long-TermWhether the action is allowed to run. Should be false if this type of action is disabled because of a security policy.
namestringyes Long-TermThe name of the action.
packagePackageInstallation  Long-TermThe package, if any, of which the action is part. See PackageInstallation.
packageIdVersionedPackageSpecifier  Long-TermThe unique identifier of the package. See VersionedPackageSpecifier.
requiresOrganizationOwnedQueriesPermissionToEditbooleanyes Long-TermThis should be set to true if this action is used by triggers, where the query is run by the organization. If true, then the OrganizationOwnedQueries permission is required to edit the action.
resourcestringyes Short-TermThe resource identifier for the action.
yamlTemplateyamlyes Long-TermA template that can be used to recreate the action.