younifyd
Menu

Render template

Render template

POST/render-template

Use it in a workflow

  1. Add a step and choose the Meilisearch connector.
  2. Pick the Render template action (under Render templates).
  3. Fill in the fields below, then reference the result from later steps as {{renderTemplate.response.data}}.

Request

Request body

Enter the body as JSON in the step's Body field.

templateobjectrequired
kindstringrequired

One ofdocumentTemplatechatDocumentTemplateindexingFragmentsearchFragmentinlineDocumentTemplateinlineFragment

indexUidoneOf
embedderstring | null

Embedder to fetch the template or fragment from. - Mandatory for `kind`s: `documentTemplate`, `chatDocumentTemplate`, `indexingFragment` and `searchFragment`.

fragmentstring | null

Name of the fragment to fetch. - Mandatory for `kind`s: `indexingFragment` and `searchFragment`.

inlineany

Inline value of the template or fragment. - Mandatory for `kind`s: `inlineDocumentTemplate` and `inlineFragment`.

documentTemplateMaxBytesinteger | null

If present, truncate document template rendering to the specified number of bytes. - Available for `kind`s: `documentTemplate`, `inlineDocumentTemplate` and `chatDocumentTemplate` - If present for `documentTemplate` overrides the setting of the index. - If missing for `documentTemplate`, the setting of the index is used. - If missing for `inlineDocumentTemplate`, the default value of 400 bytes is used.

inputoneOf
json
{
  "template": {
    "kind": "documentTemplate",
    "indexUid": null,
    "embedder": "string",
    "fragment": "string",
    "inline": null,
    "documentTemplateMaxBytes": 0
  },
  "input": null
}

Response

Returns 200 with an object. Read it in later steps with {{renderTemplate.response.data.<field>}}.

templateany

**Un**rendered template or fragment, fetched in index or echoed back from inline template in request.

renderedany

Result of rendering the template by injecting the `input` to the template. `null` if `input` was `null` or missing in the request.

json
{
  "template": null,
  "rendered": null
}

Need more? See the Meilisearch guide for connection setup and behaviour shared by every action.

Render template — Meilisearch — Documentation