orchardcore-workflow-activity

Creates custom OrchardCore workflow tasks and events with display drivers and registration.

8.2k|2.6k|Updated Nov 19, 2014
One-click install
npx skills add https://github.com/OrchardCMS/OrchardCore --skill orchardcore-workflow-activity
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: orchardcore-workflow-activity
Source: https://github.com/OrchardCMS/OrchardCore/tree/main/.agents/skills/orchardcore-workflow-activity
Command: npx skills add https://github.com/OrchardCMS/OrchardCore --skill orchardcore-workflow-activity

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Building custom workflow activities in OrchardCore requires coordinating activity classes, display drivers, Razor shape templates, and service registration, and mistakes in any of these steps cause activities to fail silently or never resume.

Core Features & Use Cases

  • Task and Event Scaffolding: Guides creation of TaskActivity and EventActivity subclasses with correct lifecycle methods, outcomes, and persisted properties.
  • Display Driver and Shape Templates: Shows how to pair each activity with an ActivityDisplayDriver and the three Razor shapes (thumbnail, design, edit) the designer expects.
  • Workflow Data Handling: Covers reading Input, writing Output, sharing Properties between activities, and evaluating WorkflowExpression fields with Liquid or JavaScript.
  • Use Case: You need a workflow that waits for an external signal before continuing. Use this Skill to build a SignalEvent that halts the workflow, gates on CanExecuteAsync, and resumes with the correct outcome.

Quick Start

Create a new OrchardCore workflow task activity that logs a message and returns a Done outcome, including its display driver and registration.

Frequently Asked Questions about orchardcore-workflow-activity

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a custom workflow activity in OrchardCore?

Create a class inheriting TaskActivity<T> for actions or EventActivity for triggers, override DisplayText, Category, GetPossibleOutcomes, and ExecuteAsync. Then add an ActivityDisplayDriver, three Razor shape templates, and register with services.AddActivity in Startup.

What is the difference between a Task and an Event in OrchardCore workflows?

A Task performs work and returns outcomes immediately, and cannot start a workflow. An Event halts the workflow via Halt(), waits for an external trigger, gates on CanExecuteAsync, and resumes through Resume, and it can serve as a workflow start point.

How do I persist activity properties in OrchardCore workflows?

Use the GetProperty and SetProperty helpers from the Activity base class, which store values as JSON in the activity's Properties bag keyed by member name. Provide a default factory so unset properties do not return null, and the state survives halt and resume.

Can OrchardCore workflow activities use Liquid or JavaScript expressions?

Yes, declare user-editable fields as WorkflowExpression<T> and evaluate them at runtime with IWorkflowExpressionEvaluator for Liquid or IWorkflowScriptEvaluator for JavaScript. The view model typically exposes the raw expression string for the editor.

Why does my OrchardCore event activity never resume?

Events must override Name to a stable value because external code references the event by name to resume it. Also verify CanExecuteAsync returns true for the triggering input and that outcome names in Resume match those declared in GetPossibleOutcomes.