Appearance
Plugins
Table of Contents
New to plugins? Ask AI to write one in Factorial, or follow Writing Your First Plugin to configure the CLI, create a template, and upload it.
Factorial is a programmable system, letting organizations tailor Factorial to their use case. Plugins can do things like sync data to and from other systems, enforce business rules transactionally, and automate common tasks.
A plugin has a collection of scripts and optional secrets. Scripts must be written in a Python subset called Starlark. Plugins can be individually enabled/disabled. They are versioned, and go through a configurable approval process before they can be enabled. Uploading an existing draft with the same name and version replaces that draft. If the existing version is not in draft, the upload fails; either return the version to draft or increment the version in the plugin manifest. Existing versions remain available for inspection. A version can carry a note saying what changed in it, shown on its page: pass one with fctl plugins upload --note, and a version AI wrote has its request as its note. An upload without one clears the note of the draft it replaces. Give each plugin a plain-language description in plugin.yaml saying what it does; it shows on the plugin's page, where you can also edit it. Omit description to keep the current one, including when you upload a new version. Creating a plugin, asking AI to write one, and changing a version's status, including enabling it, take the Plugins permission. Plugins are tracked in audit history so that there is complete traceability on when plugins were enabled. Scripts within the same plugin all share the same namespace, so code can be reused within plugins.
Hooks, receivers, jobs, and actions expose a main(args) entrypoint. Inventory constraint scripts expose constraints(ctx), and approval rules expose decide(args). Each script file must represent only one entrypoint type.
Asking AI to write a plugin
Select New on the Plugins page and give the plugin a name, such as torque-check, and optionally a description. Factorial creates an empty draft, version 1. Select the sparkles button beside it, or open it, to reach the request box at the top of the plugin's details.
Describe what the plugin should do, such as "When a work order is completed, post its number and quantity to our ERP", and select Write plugin. Writing and checking a plugin can take a few minutes. It happens in the background: the details show that Ask is writing and update when the plugin is ready, and you can leave and come back. A plugin takes one request at a time, so the request box waits until the current one finishes. A server restart while Ask is writing ends the request without a draft. If you were watching, the details say Ask stopped before it finished; ask again.
The model writes plugin.yaml and the plugin's scripts. Factorial then checks the answer the way an upload would: it reads the manifest, compiles every script, and saves the plugin in a transaction that is rolled back. When checking finds a problem, Factorial sends the model what went wrong and where, and the model fixes it. A request gets at most four answers.
Dry runs on recent records
Compiling catches mistakes in how a script is written, not in what it does. An administrator can let Ask also dry run each answer against your records, with Dry run plugins AI writes against recent records in AI features. It is off by default, and the request box says whether it is on. When it is on, Factorial dry runs each entrypoint as the person who asked, in a transaction that is rolled back:
- Hooks run with the events of the three most recent records their event applies to. A field-change hook gets the record's current value as both the old and the new value. Task field hooks are only compiled.
- Jobs run with
None. - Receivers run with a sample request body the model writes for them.
- Actions and inventory constraints are only compiled.
HTTP requests are recorded but not sent. Each run has one second, and fails rather than wait for a record someone else is changing, so it doesn't hold up people's work. Writes it makes still run the hooks of enabled plugins, and are rolled back with the rest. A run that creates a work order, issue, or kit still uses up its number, so the next one made skips it. The model gets back the errors runs raise and what failed runs printed. Those can include the values of your records, which is why dry runs are off until an administrator turns them on. They make for much better plugins: errors that only show up when a script reads real records are fixed before anyone reviews the draft.
The result is saved as a draft version. If the plugin's newest version is a draft, Ask rewrites that draft. Otherwise Ask writes the next version as a new draft, and the version that is enabled keeps running. Ask always changes the newest version, whichever version's details you ask from. A draft does nothing until someone with the Plugins permission enables it, so read its scripts first. A version written by AI shows the request that wrote it as its note. If problems were left after the last answer, the version lists them, and you can ask again to fix them.
A request that doesn't produce a plugin says why above the request box, to people with the Plugins permission, and leaves the plugin as it was. That covers a reply with no plugin, such as when the plugin API can't do what you asked, and a plugin that still didn't compile after the last answer. The reason shows for an hour, or until the plugin is uploaded to, gains a version, or has its status or description changed. If the plugin was uploaded to, gained a version, or had its status or description changed while the model was writing, the answer is dropped rather than quietly undoing that change; ask again.
Factorial sends the provider your request, the plugin's current files, the plugin API reference that fctl plugins docs prints, the hook events, your fields' names, keys, types, and options, your roles, and a few written instructions. With dry runs off, it never sends records. With them on, it also sends what failed dry runs raised and printed, which can quote records.
Asking uses the same AI keys and settings as Analytics: it is off until an administrator turns on AI features, and With, under the request, picks the key and model as described in Choosing a key and model. Hidden AI features remove the request box and the sparkles buttons. Scripts over 60 KB in total are too large to change this way, since the model is sent the whole plugin; upload changes instead.
Sharing script logic
Each hook, receiver, action, job, inventory constraint, or approval rules script in plugin.yaml must use a distinct entrypoint file. This includes two hooks subscribing to different events: they cannot share the same file path. Each event may have only one subscription per plugin.
To reuse validation or other logic, put it in a helper module and load it from separate entrypoint files:
yaml
hooks:
- event: inventorycreate
file: hooks/on_create.py
- event: inventory_cf_grade
file: hooks/on_grade.pyBoth entrypoint files can contain:
python
load("helpers.py", "validate_inventory")
def main(args):
validate_inventory(args)Define validate_inventory in helpers.py at the plugin root. Helper modules can be loaded by any number of scripts and do not need a manifest entry. Keep queries and writes inside functions; module initialization has no session.
Inventory constraints
Inventory constraint scripts narrow the inventory offered for an installation requirement on a work order task. Factorial applies their predicates before pagination and evaluates them again against current context when installing inventory. Every enabled plugin's constraints must pass, together with Factorial's built-in installation rules.
Register one constraint entrypoint in the existing plugin manifest:
yaml
name: pedigree
version: 1
inventory_constraints: pedigree.pyThe script returns a declarative expression. Ordinary Starlark branching chooses which rules apply; inventory represents the candidate inventory being filtered:
python
load("factorial:constraints", "inventory", "all_of", "any_of", "require")
def constraints(ctx):
allowed = {
"Tier 1": ["Tier 1"],
"Tier 2": ["Tier 1", "Tier 2"],
"Tier 3": ["Tier 1", "Tier 2", "Tier 3"],
}
if ctx.parent == None:
fail("A parent assembly is required to determine pedigree.")
pedigree = ctx.parent.fields.get("pedigree")
if pedigree not in allowed:
fail("Set the parent assembly's pedigree first.")
rules = [require(
inventory.field("pedigree").in_(allowed[pedigree]),
id="compatible_pedigree",
message="Component pedigree must satisfy the parent pedigree.",
)]
if ctx.work_order.fields.get("program") == "Flight":
rules.append(require(
all_of(
inventory.field("program").eq("Flight"),
any_of(
inventory.field("supplier_approved").eq(True),
inventory.field("waiver_reference").is_set(),
),
),
id="flight_material",
message="Flight material requires a matching program and supplier approval or a recorded waiver.",
))
return all_of(*rules)Create the referenced standard fields and options before enabling this plugin. The waiver condition above checks only that a reference is recorded; it does not establish whether the waiver covers the part or program.
Context and predicates
Factorial loads context from the selected task and requirement. Scripts cannot supply a different context to bypass constraints.
| Context | Available values |
|---|---|
ctx.requirement | id, part_id, quantity (decimal string), accepted_part_ids (including substitutes) |
ctx.parent | Output inventory id, part_id, fields; None if no active output is available. Uses the nearest work order ancestor with an output when the task's work order has none. |
ctx.work_order | The task's work order id and fields |
ctx.task | id |
fields is a dictionary indexed by field key. In constraint context, select values are option labels and multiselect values are lists of labels, matching filter operands. Ordinary plugin query includes still return option UUIDs. Numbers, dates, and date & time values are strings. Checkboxes are booleans. Unanswered fields are None, except checkboxes (False) and multiselects ([]). Renaming a key or option label requires updating scripts that refer to it.
inventory.field(key) selects a custom field, without the query API's cf_ prefix. Supported methods are eq, neq, in_, not_in, gt, gte, lt, lte, is_set, and is_unset, subject to the field's supported operators. Use strings for decimal operands to preserve precision, such as .gte("1.25"). Integer and boolean operands are also accepted. Membership takes a nonempty list or tuple of at most 100 values. Unknown fields, option labels, and unsupported operators produce errors.
Combine predicates with all_of(...) and any_of(...). Empty all_of() allows all otherwise eligible candidates; empty any_of() allows none. Wrap an expression in require(expression, message="...", id="...") to explain a rejection; id is optional. Use ordinary if statements for concrete context values. Using a symbolic predicate with if, and, or, or bool raises an error.
Scripts can load helper modules from their own plugin. They cannot query records, perform writes, or send HTTP requests. Execution is bounded by the plugin time and instruction limits; each returned expression is limited to 64 nodes, 16 nesting levels, and 16 distinct predicates. A script error stops the picker or installation rather than falling back to unconstrained results.
This prototype applies to task installation requirements. It does not constrain general inventory installation outside a task, consumption, or kitting, and does not recalculate historical fulfillment using pedigree rules.
Testing constraints
Use fctl plugins test with a fixture referencing existing records. Constraint fixtures evaluate only the selected script's predicates; they do not install inventory or check quantity, task status, or other built-in installation rules. Draft scripts can be tested before enabling the plugin.
json
[{
"name": "reject lower-pedigree component",
"script": "pedigree.py",
"input": {
"task_id": "EXISTING-TASK-UUID",
"requirement_id": "EXISTING-REQUIREMENT-UUID",
"inventory_id": "EXISTING-INVENTORY-GROUP-UUID",
"eligible": false
}
}]List the fixture file under fixtures in plugin.yaml, as with other plugin fixtures. eligible is the expected result; both allowed and rejected candidates can be checked. Script and configuration errors always fail the fixture.
Approval rules
Approval rules decide an issue disposition in place of its type's count of approvals. They own the whole decision: they can approve or reject a disposition the moment it is proposed, wait for particular people, and decide when the signatures collected are enough. An administrator chooses which disposition types use a plugin's rules in organization settings.
People never see the rules' code. They see the plugin's description, which should say in plain language what the rules require, and the sentence the rules return each time they run, such as "Waiting on 1 more from the MRB". Write the description for the people signing, not for programmers.
Register one rules entrypoint in the plugin manifest:
yaml
name: mrb-rules
version: 1
description: |
Small scrap lots under 5 pieces are approved at once. Everything else needs two signatures
from the MRB role, and a customer representative when the work order is for a flight program.
approvals:
disposition: rules.pyThe script defines decide(args). Like a hook's main(args), it gets a list: one context for each disposition to decide, often several at once, for example when the review center shows every disposition waiting on rules. It returns a list with one decision for each, in the same order:
python
load("factorial:approvals", "approve", "reject", "pending", "role", "permission", "user")
def decide(args):
return [decide_one(ctx) for ctx in args]
def decide_one(ctx):
d = ctx.disposition
if d.rejections:
return reject("Rejected by " + d.rejections[0].user.name + ": " + d.rejections[0].body)
if d.base == "SCRAP" and ctx.record.inventory and int(ctx.record.inventory.fields.get("qty") or 0) < 5:
return approve("Small scrap lot")
mrb = [s for s in d.approvals if "MRB" in s.user.roles]
if len(mrb) < 2:
return pending("Waiting on %d more from the MRB" % (2 - len(mrb)), signers=[role("MRB")])
return approve("Two MRB signatures")| Decision | Effect |
|---|---|
approve(note) | The disposition is approved and applied at once, as the plugin. note is optional and shown as "Approved by rules: note". |
reject(reason) | The disposition is rejected, as the plugin. reason is required and shown on the disposition. |
pending(status, signers=[...], request=[...]) | The disposition waits. status is required and shown on the disposition. |
If decide(args) returns anything but a list of decisions as long as args, every disposition in the call fails, since Factorial can't tell which decision is whose. Rules that look things up with query should make one query for the whole list, with in_ on the ids the contexts hold, rather than one for each context.
While pending, signers says who may sign now: role(name) for everyone holding a role, permission(name) for everyone holding a permission, such as permission("DISPOSITION"), and user(id) for one person. When signers is empty or left out, people holding the permission the type requires may sign. To let people chosen by a field or tag sign, query for them and name them with user(id).
Factorial never stores who may sign. It runs the rules whenever it shows a disposition: on the issue page, in the list of people who can be asked to review it, and in the review center, where they decide who sees it under Can approve. These runs only read, so they decide nothing, and query reads the same data whoever is viewing. When someone signs, Factorial runs the rules without their signature and checks the signer against who those name, so a signature always follows the rules as they are now. The review center runs the rules of up to 1,000 waiting dispositions at once. Past 1,000, it runs the oldest 1,000 and says so: the newer ones don't show under Can approve, and their approve and reject actions there are disabled. Open the issue to sign them, and work down the queue.
request asks people by name, as user ids or user(id). Each gets an ordinary review request, with a notification and an entry in their Inbox, and may sign. A request is made on behalf of whoever's action ran the rules, once: a person the rules keep asking for isn't asked again on each run, so a request someone withdrew stays withdrawn until the rules stop asking for that person and later ask again. People can ask others to review a disposition decided by rules only if the rules, run when they ask, let those people sign.
The rules decide when a disposition is proposed, on each signature, when someone asks people to review it, and when someone selects Check again on the disposition. They run in the same transaction as that change, before it's saved, so what they decide is saved with it or not at all. What they read can also change without anyone touching the disposition, for example an inventory field or something they look up with query. The disposition then shows what they'd decide now, and the next time they run, for example when someone selects Check again, they carry it out. Each run that decides records the plugin version that ran. A signature never decides anything by itself: the rules see every signature, approvals and rejections, and decide what they mean. A signer's rejection doesn't reject the disposition unless the rules return reject() for it. Two rejections are always final: the person who proposed a disposition taking it back, and a rejection while the rules can't run (see below). Each person still signs once, the person who proposed a disposition can't approve it, and a rejection needs a reason.
Context
| Context | Available values |
|---|---|
ctx.disposition | id, type, base, permission, justification, proposed_by (a user, or None when an organization key or plugin proposed it), proposed_at, signatures, approvals, rejections, requested (user ids asked so far), plugin, last_status, rules_failed |
ctx.issue | id, number, title |
ctx.record | id, subject, task_id, work_order_id, inventory (id, part_id, trace_number, fields), part (id, part_number, revision), work_order (id, number, fields); None where the record has none |
A user is id, name, email, and roles, the names of the roles they hold now. A signature is user, decision (APPROVED or REJECTED), body, roles_when_signed, and signed_at. Times are RFC 3339 strings in UTC. fields follow the same conventions as inventory constraint context.
Rules can load helper modules and read records with query. They can't write or send HTTP requests: what they decide is carried out in the same transaction as the action that ran them, so anything else they did couldn't be taken back. Use a hook on dispositionstatuschange for side effects. What a script prints goes to the plugin's execution logs.
Rules fail closed. When a script raises an error, a query fails or takes longer than 2 seconds, a call takes longer than 10 seconds, it returns something else, or it names a role, permission, or user that doesn't exist, the disposition stays pending and shows Approval rules failed with the error. While they fail, nobody can sign it or be asked to review it. Check again runs the rules again once the plugin is fixed. When the rules decide a disposition but Factorial can't carry that out, for example an approval its inventory no longer allows, the change that ran them fails with why, and nothing it did is saved.
A disposition keeps the plugin its type named when it was proposed. While that plugin isn't enabled, its rules can't run, so the disposition can't be approved. Anyone with the permission its type requires, or the person who proposed it, can reject it, and the record can then get a new disposition under the type's current settings.
Rules for the whole issue
Each context holds only the record its disposition is on. Rules that depend on the rest of the issue look it up with query: an issue's inventory, tasks, and work_orders are the affected records linked to it now, so filtering on qn.issues.inventory.part.part_number finds the issues raised on a part's lots and serial numbers. One query over the ids in args answers it for every context.
These rules require two quality engineers on any disposition of an issue that affects a ball screw assembly, BSC-12, even a disposition on another of its records. Every other disposition needs one signature from a manufacturing engineer, quality engineer, or engineering lead:
python
load("factorial:approvals", "approve", "reject", "pending", "role")
CRITICAL_PART = "BSC-12"
QUALITY = "Quality Engineer"
ANYONE = ["Manufacturing Engineer", "Quality Engineer", "Engineering Lead"]
def decide(args):
critical = issues_with_part([ctx.issue.id for ctx in args], CRITICAL_PART)
return [decide_one(ctx, ctx.issue.id in critical) for ctx in args]
def issues_with_part(issue_ids, part_number):
found = {}
cursor = ""
for _ in range(10):
page = query(entity=qn.issues, where=[
op.in_(qn.issues.id, issue_ids),
op.eq(qn.issues.inventory.part.part_number, part_number),
], cursor=cursor)
for row in page.data:
found[row["id"]] = True
if page.next == None:
return found
cursor = page.next
fail("Too many issues")
def decide_one(ctx, critical):
d = ctx.disposition
if d.rejections:
return reject("Rejected by " + d.rejections[0].user.name + ": " + d.rejections[0].body)
roles = [QUALITY] if critical else ANYONE
needed = 2 if critical else 1
signed = [s for s in d.approvals if any([r in s.roles_when_signed for r in roles])]
if len(signed) >= needed:
return approve("Signed by " + ", ".join([s.user.name for s in signed]))
waiting = "%d more %s" % (needed - len(signed), "Quality Engineer, for the ball screw" if critical else "signature")
return pending("Waiting on " + waiting, signers=[role(r) for r in roles])The person who proposed a disposition can't approve it, so an organization with exactly two quality engineers needs someone else to propose dispositions on ball screw issues.
Testing approval rules
Fixtures run the rules on an existing disposition and compare the decision, without deciding it. The disposition doesn't need to be of a type that uses the rules, so rules can be tried before an administrator turns them on.
json
[{
"name": "small scrap lot approves itself",
"script": "rules.py",
"input": {
"disposition_id": "EXISTING-DISPOSITION-UUID",
"expected": "APPROVED"
}
}]expected is APPROVED, REJECTED, or PENDING. Script errors and names that don't exist always fail the fixture.
Hooks
Hook scripts subscribe to a specific event in plugin.yaml. Factorial calls the script's main(args) function with a tuple of standardized HookEvent values. Each event provides a subject_id, an event name, and a data dictionary:
python
def main(args):
for event in args:
print(event.subject_id)
print(event.event)Manifest subscriptions and payloads use the same event name, such as commentcreate.
A hook invocation may contain multiple events. Hook scripts can send HTTP requests, raise validation errors or warnings, send notifications, schedule work, and modify custom fields.
Scripts write through factorial, which has every write the API has, named after its route: POST /api/v1/fields/options is factorial.fields.options.create, and PATCH /api/v1/work-orders/status is factorial.work_orders.status.update. Each takes inputs=[...] and needs the same permission as its route. Plugins can't change users, roles, API keys, plugins, or organization settings such as locations and review policies. fctl plugins docs lists every write and its inputs.
A script sends a notification with factorial.notifications.create, to people by user or by role. It shows in their notifications under the plugin's name and links to the inventory or work order it is about:
python
factorial.notifications.create(inputs=[{
"role_ids": [quality_role_id],
"message": "Capacitor lot received, inspect before use.",
"inventory_id": event.subject_id,
}])Hooks run inside the change that triggered them. A hook that calls fail("...") refuses that change: nothing it did is saved, and the person who made it sees the message, or an API caller gets it as a 400 error.
Events generated by hook writes trigger matching hooks in the next round. Each round batches events by event type and actor; a hook can run again when a later write triggers it. All rounds run in the original transaction. A downstream hook failure rolls back the original change and every chained database write. HTTP requests already sent cannot be rolled back.
A transaction allows up to 32 hook rounds and 100 hook invocations. Exceeding either limit refuses the change with an error. Avoid cycles where hooks keep triggering one another.
Field-change hooks
Subscribe with <entity>_cf_<field_key>, for example inventory_cf_torque. Supported entities are inventory, work_orders, users, and tasks (work-order tasks). subject_id identifies the owning record; inventory uses the inventory group UUID. Hooks run on first entry, changes, and clearing, but not unchanged values. Field configuration changes and lifecycle copies do not trigger field-change hooks. UI, API, and plugin writes use the same hooks.
yaml
hooks:
- event: inventory_cf_torque
file: hooks/validate_torque.pypython
def main(args):
for event in args:
previous = event.data["old_value"]
current = event.data["new_value"]
if current == None:
fail("Torque cannot be cleared.")Every event has an immutable data dictionary. Existing events use {}. Field-change data contains entity_type, field_id, field_key, old_value, and new_value. Text, numbers, dates, and date & time values are strings; numbers preserve decimal precision. Checkboxes are booleans, select values are option UUID strings, and multiselect values are lists of option UUID strings. Unanswered values are None, except checkboxes (False) and multiselects ([]).
Renaming a field key updates its subscriptions atomically across all uploaded plugin versions, including drafts and disabled versions. Script source and local manifests are not rewritten. Update local manifests before uploading again; unknown field keys are rejected. A field subscription can be registered before placing that field on the entity type.
Hook fixtures accept either subject-ID strings or objects with subject_id and data. For example, use this fixture input to test a cleared number:
json
[{"subject_id": "EXISTING-INVENTORY-GROUP-UUID", "data": {
"entity_type": "inventory", "field_id": "EXISTING-FIELD-UUID",
"field_key": "torque", "old_value": "10", "new_value": null
}}]Fixture objects use the uploaded subscription as the event name. Fixtures run the script with supplied data; they do not perform the triggering field write.
Querying Standard Fields
Include standard fields when querying inventory, work orders, or users. Values are returned in a dictionary keyed by the field definition’s key:
python
def main(args):
page = query(entity=qn.inventory, include=[include.inventory.fields])
for item in page.data:
program = item["fields"].get("customer_program")
print(program)Use include.work_orders.fields or include.users.fields for the other supported types. Follow page.next when querying additional pages. Loading fields batches the values for the entire page.
Text, numbers, dates, and date & time values are strings; numbers retain their decimal precision. Checkboxes are booleans. Select values are option UUIDs, and multiselect values are lists of option UUIDs, so renaming an option does not break comparisons. Unanswered values are None, except unchecked checkboxes (False) and empty multiselects ([]). Without the include, fields and field_metadata are None.
item["field_metadata"]["customer_program"] contains field_id, type, and archived. Archived values remain readable but cannot be edited.
Standard fields support query filters on inventory, work orders, and users, including through relationships. Identify a field with cf_ followed by its key: for example, {"f":"cf_pedigree","o":"IN","v":["1","2"]} matches either option label. Select and multiselect filters use option labels, while included field values return option UUIDs. See Filtering by fields for operators and unanswered-value behavior.
To write values, call factorial.entity_field_values.update(inputs=[...]). Each input identifies entity_type (inventory, work_orders, or users), entity_id, and field_key, plus exactly one of value, checked, or option_ids. Inventory IDs are inventory group IDs, the same IDs returned by queries. Use an empty value or option_ids list to clear a value. A batch must use one entity type and cannot write the same field on the same record twice. Writes require the same permissions as editing values in the app.
python
factorial.entity_field_values.update(inputs=[{
"entity_type": "inventory",
"entity_id": inventory_id,
"field_key": "customer_program",
"value": "Corvane witness testing",
}])Standard-field writes dispatch matching field-change hooks.
Querying issues
query(entity=qn.issues) returns issues with their id, num, kind, status, title, description, owner_id, resolution, created_at, and closed_at. Filter them by their own fields, their owner, or what they affect now: inventory, tasks, and work_orders reach the issue's linked records and continue from there, such as qn.issues.inventory.part.part_number or qn.issues.tasks.work_order.procedure.part.part_number. A record unlinked from the issue, or replaced by the pieces of a split, no longer matches.
python
rows = query(entity=qn.issues, where=[
op.eq(qn.issues.kind, "NCR"),
op.eq(qn.issues.inventory.part.part_number, "BSC-12"),
]).dataReceivers
Receiver scripts register an endpoint at yoursubdomain.factorialhq.com/receivers/{plugin-name}/{endpoint}, and main(args) is invoked when that endpoint receives a POST request. args contains the request body. This can be useful for using Factorial as a receiver of webhooks. For example to sync parts from a PLM in realtime, the PLM may have a webhook where it sends the part information to a configurable endpoint every time a new part is created. The receiver script would then be invoked with the payload from the POST request and create the part in Factorial. The request is automatically authenticated and API keys for the rest of the Factorial API are valid for these receiver endpoints.
Jobs
Jobs run a script periodically on a certain schedule. Factorial invokes main(args) with args set to None. Jobs can import data from other systems, export Factorial data, close stale tasks, or send reminders.
Set a job's schedule in plugin.yaml to one of the following values:
every_15_minevery_2_hoursevery_4_hoursevery_8_hoursevery_1_dayevery_7_days
Actions
Actions are invoked through slash commands to the command bar anywhere in the app. An action script has a configured input schema, which is a set of typed fields. When a user invokes the slash command, a modal appears with the fields they must enter, and Factorial invokes main(args) with the submitted values. The script is run with the permissions of the user who invoked it. This can help automate routine tasks, for example, if a certain rework process requires scheduling three separate work orders, a slash command could be written that collects the inventory that needs work, and an assignee, and schedules all three work orders in one command.
Issues
Plugins can read issues with query, and approval rules can use them to decide dispositions. Other plugin support for issues is planned. Plugins will be able to raise issues, link affected records, and place holds, for example from a field-change hook when a recorded value falls outside an acceptable range. Hooks will run when issues are created and changed and when their dispositions are reviewed and applied, and a hook will be able to require customer authorization on a disposition.
Testing Scripts
All script types support running them manually with a mocked payload, side effects will be listed in the execution so you can see what they would have done if enabled. External requests are not run by default.
Execution Logs
Script execution logs are available in app for debugging purposes. Detailed log execution data is only maintained for the last 30 days by default.
Coding agents
Besides asking in Factorial, your own coding agent can write plugins with fctl. fctl plugins docs prints the plugin API reference, the same one Ask sends, and fctl plugins upload uploads the result. Uploads are compiled the same way: a script that doesn't parse, uses a name nothing defines, or loads a file the plugin doesn't have is refused.
Example Use Case: Pedigree
COMING SOON
Reference
Coming Soon