index/create FormID 20300
Create a new Elasticsearch index with explicit field mappings and settings. Defines data types, analyzer configuration, shard count, and replica count before any documents are indexed. Routes to the error port if the index already exists.
When to Use
- Controlled schema definition: Define field types explicitly —
keywordfor exact-match filtering,textwith a custom analyzer for full-text search,datefor range queries — before any documents are indexed. Dynamic mapping can silently infer wrong types. - Custom analyzers: Configure language-specific analyzers, synonym filters, or n-gram tokenizers in the
Settingsblock so search behaves exactly as intended from the first document. - Environment provisioning: A workflow provisions a new tenant or environment — create the required indices as part of setup before any data flows in.
- Time-series index rotation: A scheduled workflow creates next month's log or metrics index (e.g.
app-logs-2025-09) in advance, so the first write lands on a properly-configured index rather than triggering dynamic creation.
document/create, Elasticsearch creates the index automatically with dynamic mapping. Use index/create first whenever field type control matters — particularly for fields used in aggregations, sorting, or exact-match queries, which require keyword mapping rather than text.
Configuration
Connection
| Field | Required | Description |
|---|---|---|
Host | Required | Elasticsearch cluster URL, e.g. https://localhost:9200. |
Username | Optional | Elasticsearch username (required if security is enabled). |
Password | Optional | Password for the specified username. |
IgnoreSSL | Optional | Default false. Skip TLS validation. Development use only. |
Operation
| Field | Required | Description |
|---|---|---|
IndexName | Required | Name for the new index. Must be lowercase with no spaces. Supports BizFirst expressions for dynamic names, e.g. app-logs-{{ $now | date('YYYY-MM') }}. |
Mappings | Optional | Elasticsearch mappings object defining field types and configurations. Entered as JSON in the code editor. If omitted, Elasticsearch uses dynamic mapping for all fields. |
Settings | Optional | Elasticsearch index settings object — shard count, replica count, custom analyzers, refresh interval, etc. Entered as JSON. If omitted, Elasticsearch cluster defaults apply. |
Validation Errors
| Error Code | Cause |
|---|---|
VAL_MISSING_INDEX_NAME | IndexName is empty. |
Output
Success Port
| Field | Type | Description |
|---|---|---|
status | string | "success" |
indexName | string | The name of the newly created index. |
created | boolean | true when the index was created successfully. |
Error Port
Fires if the index already exists (400 resource_already_exists_exception), authentication fails, or a settings/mappings validation error occurs. The error output contains errorCode and message fields.
index/get before this node to check existence, or handle the error port to treat "already exists" as acceptable in idempotent provisioning workflows.
Examples
Product Catalogue Index with Explicit Mappings
{
"resource": "index",
"operation": "create",
"IndexName": "products",
"Mappings": {
"properties": {
"title": { "type": "text", "analyzer": "english" },
"sku": { "type": "keyword" },
"category": { "type": "keyword" },
"brand": { "type": "keyword" },
"price": { "type": "float" },
"in_stock": { "type": "boolean" },
"indexed_at": { "type": "date" },
"tags": { "type": "keyword" }
}
},
"Settings": {
"number_of_shards": 2,
"number_of_replicas": 1
}
}
sku, category, and brand use keyword so they support exact-match filters and aggregations. title uses the English analyzer for stemmed full-text search.
Time-Series Log Index — Dynamic Name
{
"resource": "index",
"operation": "create",
"IndexName": "app-logs-{{ $now | date('YYYY-MM') }}",
"Mappings": {
"properties": {
"timestamp": { "type": "date" },
"level": { "type": "keyword" },
"service": { "type": "keyword" },
"message": { "type": "text" },
"traceId": { "type": "keyword" }
}
},
"Settings": {
"number_of_shards": 1,
"number_of_replicas": 0,
"refresh_interval": "5s"
}
}
Run this via a scheduled workflow at the start of each month. The refresh_interval of 5s reduces indexing overhead for high-volume log ingestion.
Index with Custom Analyzer
{
"resource": "index",
"operation": "create",
"IndexName": "articles",
"Settings": {
"analysis": {
"analyzer": {
"autocomplete": {
"tokenizer": "autocomplete_tokenizer",
"filter": ["lowercase"]
}
},
"tokenizer": {
"autocomplete_tokenizer": {
"type": "edge_ngram",
"min_gram": 2,
"max_gram": 20,
"token_chars": ["letter", "digit"]
}
}
}
},
"Mappings": {
"properties": {
"title": {
"type": "text",
"analyzer": "autocomplete",
"search_analyzer": "standard"
}
}
}
}
Configures an edge n-gram tokenizer for autocomplete search on the title field. The search_analyzer uses standard so query terms are not n-grammed on the query side.