---
title: "Create a file pattern based cron trigger for the given ensemble"
method: POST
path: "/ensembles/{em-name}/triggers/file-pattern"
tags: ["Trigger"]
---

# Create a file pattern based cron trigger for the given ensemble

`POST /ensembles/{em-name}/triggers/file-pattern`

Create a file pattern based cron trigger for the given ensemble.

## Request body

- FilePatternTrigger
  - `id` integer
  - `ensemble_id` integer
  - `name` string, required
  - `trigger_type` string, required
  - `state` 'READY' | 'RUNNING' | 'FAILED' | 'STOPPED', required
  - `workflow` object, required
    - `script` string — An absolute path to the workflow planning script. This script should invoke pegasus-plan directly or through the Python API. The "submit" flag in pegasus-plan cannot be used here.
    - `args` string
  - `args` object
    - `interval` integer — Duration of each interval, in seconds, that this trigger will submit a new workflow to the ensemble manager.
    - `timeout` integer — Timeout duration, specified in seconds.
    - `file_patterns` string[]

## Response `200`

Success

- Trigger
  - `id` integer
  - `ensemble_id` integer
  - `name` string, required
  - `trigger_type` string, required
  - `state` 'READY' | 'RUNNING' | 'FAILED' | 'STOPPED', required
  - `workflow` object, required
    - `script` string — An absolute path to the workflow planning script. This script should invoke pegasus-plan directly or through the Python API. The "submit" flag in pegasus-plan cannot be used here.
    - `args` string

## Other responses

- `400` — Bad request
- `401` — Not authenticated
- `404` — Resource not found
- `default` — Internal server error

## Changes

- **2026-07-17** `bc40e50a342a` — 1 info
  - api tag `Ensemble` removed
- **2021-01-12** `c4d83189c07b` — 3 info
  - api tag `Ensemble` added
  - api tag `Trigger` added
  - added the new optional `query` request parameter `pretty-print` to all path's operations
- **2021-01-11** `c605463405d9` — 1 info
  - api tag `Trigger` removed

[Change history](https://skmtc.dev/pegasus-isi/apis/ensemble-manager-api/changes/ensembles/:em-name/triggers/file-pattern/post.md)

---

[API](https://skmtc.dev/pegasus-isi/apis/ensemble-manager-api.md) · [All operations](https://skmtc.dev/pegasus-isi/apis/ensemble-manager-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/pegasus-isi/ensemble-manager-api/revisions/bc40e50a342a/schema)
