Giter Club home page Giter Club logo

elsa-documentation's People

Contributors

agriffard avatar douglasg14b avatar garyjurgens avatar hamidrezaashkiyan avatar happtim avatar herblinernexxbizz avatar huzarensalade avatar icedmango avatar jeremycook avatar lordlezehaf avatar mariusvuscannx avatar maruu23 avatar mohdali avatar polferov avatar pontiusthebarbarian avatar rosdi avatar sfmskywalker avatar sjd2021 avatar snakiex avatar vahidnaderi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

elsa-documentation's Issues

Configuring Persistence Providers for Workflow Runtime and Management

Create a comprehensive guide on setting up the supported persistence providers, such as EF Core with SQL Server and MongoDB. The documentation should cover the configuration steps for both Workflow Runtime and Workflow Management modules, ensuring users can seamlessly integrate their preferred storage solutions.

Objectives:

  • Provide step-by-step instructions on configuring various persistence providers.
  • Detail the configuration process for both the Workflow Runtime and Workflow Management modules with each storage option.
  • Highlight any prerequisites or considerations specific to each persistence provider or module.

This guide will serve as a valuable resource for developers looking to tailor Elsa Workflows to their project's needs by leveraging different database technologies for persistence.

Webhook Extensibility

The Webhooks module is used by the RunTask activity - how does one extend the Webhooks module with custom events?

Blocking & Trigger Activities

We need a section about writing activities that are blocking and that can be used as triggers. This should include details about how to resume & trigger them.

Create sample for updating or signaling the Workflow state

We need to bring example in documentation of how to updating the and/or signaling and/or querying states of any variable states in workflow

// Update state of workflow.
Task UpdateWorkflowParams(GreetingParams greetingParams) => _currentParams = greetingParams;

// Update state of workflow.
Task CompleteWorkflow() => _complete = true;
then
Workflow.WaitCondition(() => _complete == true); triggered

// Query state in Workflow
string GetValueOfName() => _name;

HTTP Endpoint Activity

Describe the HTTP Activity. how it works and how to invoke workflows with this activity used as a trigger.

Architecture

There should be a topic on the ELSA architecture, probably from different levels and perspectives - starting with a high-level description about what happens when a workflow executes.

  • Describe logic from start to end as a workflow is executes
  • Execute vs Dispatch
  • Bookmarks + Triggers + Stimuli
  • Workflow Execution, Workflow Runtimes
  • Multitenancy
  • Mindmap / schema around core functionality and surrounding features + packages

Workflow Testing Elsa V3

Hi,

I am in search of the equivalent packages for workflow testing/visualisation you had in Elsa V2 - Elsa.WorkflowTesting.Api and services.AddWorkflowTestingServices(); - but for V3? Are these available or are they on your radar for a release anytime soon?

Many thanks

Liam.

Incorrect package reference to Elsa.WorkflowProviders.FluentStorage

Documentation Improvement Request

Documentation Issue Overview

Is your documentation issue related to a specific problem? Please describe.
https://v3.elsaworkflows.io/docs/guides/loading-workflows-from-json this documentation area has a bug

Proposed Documentation Changes

Describe the changes or additions you'd like
This statement: Add a package reference to Elsa.WorkflowProviders.FluentStorage to the workflow server project.
...is incorrect, it should say:
Add a package reference to Elsa.WorkflowProviders.BlobStorage to the workflow server project.

Affected Sections

Identify which sections of the documentation are affected
setup guide

Impact of Changes

Explain the potential impact
Fixes a bug that makes getting started difficult

Additional Context

Add any other context or visuals
n/a

DropIns

Add a section about configuring and using the DropIns module.

Workflow Context

We need documentation about the V3 version of Workflow Context.

Significant Onboarding Gaps

There are some significant onboarding gaps I experienced that the docs could alleviate

This is to just list these out.

  1. Using postgres as the storage provider needed to ensure:
    1. I had an AppDbContext with a constructor with a generic DbContextOptions and not a non-generic one.
      • Otherwise you get The DbContextOptions passed to the AppDbContext constructor must be a DbContextOptions<AppDbContext>. When registering multiple DbContext types, make sure that the constructor for each context type has a DbContextOptions<TContext> parameter rather than a non-generic DbContextOptions parameter.
    2. The calls to UseEntityFrameworkCore need to ensure they include the ef => ef.UsePostgreSql(appConfig.DbConnectionString) configuration.
  2. If you're using Micrososft.EntityFrameworkCore.Design you're going to have problems with the Microsoft.CodeAnalysis.CSharp.Workspaces dependency version because elsa has it pinned as a specific version
  3. elsa-workflows/elsa-core#5385 (If I resolve this, I'll add the necessary finagling here)
  4. If you use OpenAPI SwaggerGen, it will explode with:
    • fail: Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware[1] An unhandled exception has occurred while executing the request. Swashbuckle.AspNetCore.SwaggerGen.SwaggerGeneratorException: Failed to generate Operation for action - HTTP: POST /elsa/api/identity/secrets/hash. See inner exception ---> Swashbuckle.AspNetCore.SwaggerGen.SwaggerGeneratorException: Failed to generate schema for type - Elsa. Identity.Endpoints.Secrets.Hash.Request. See inner exception ---> System.InvalidOperationException: Can't use schemaId "$Request" for type "$Elsa.Identity.Endpoints.Secr ets.Hash.Request". The same schemaId is already used for type "$Elsa.Identity.Endpoints.Users.Create.Request"
  5. One you do get it running (The Server in asp.net, and the Studio via docker). The documentations recommendation of authentication doesn't work. It logs in, yes, but all requests from Studio to the server result in 401 unauthorized...
    • IDK how to solve this one yet.... Might have to do with the auth schema...? Crap idk.
    • Edit: Day later, still have no idea why the Elsa endpoints refuse auth, I'm going to have to yoink this out unfortunately, I imagine this will be the continued integration experience (Whack-a-mole), the project just isn't ready yet :(
  6. If you use Hangfire you're going to have slight pain because the Elsa dependency is pinned to 1.8.6 (Current is 1.8.12). (You'll need to explicitly install the version needed)
    • image
    • The docs don't indicate how to use/install it, or where/how it's used/activated, you have to dig into the source code to figure that out yourself
      • Only use this feature if you are not configuring Hangfire yourself If we are, is there any additional configuration Elsa needs?
    • โ‰ If I don't use the hangfire background activity scheduler, do I not get background activity scheduling? Why hangfire for it vs the default?
  7. Integrating to your own auth system seems.... unknown at this point. How to use my own users & permissions? Is there an integration guide/examples for this?

It's been 6h ~11h trying to get this running on an existing application, this is brutal ๐Ÿ˜ฐ

Adding Query Builder as Custom Input

Hi,

I'm planning to add the Query Builder as the Custom Input in Elsa V2, Please help to provide the documentation or the sample on how to achieve this scenario
image

Custom Icons

Document how to provide custom icons for custom activities.

Alterations

We need to port the Alterations documentation

In the Elsa Documentation for 3.0, in order to create a new user we are supposed to call the following rest endpoint

In the Elsa Documentation for 3.0, in order to create a new user we are supposed to call the following rest endpoint

https://server-name/elsa/api/identity/applications \
--header 'Content-Type: application/json' \
--data '{
    "name": "Postman",
    "roles": ["admin"]
}

However, it's applicable only for localhost as the documentation states

By default, creating applications is allowed for anonymous requests from the localhost.

I would like to host the application on my personal azure platform with App Service which will not have localhost. What should be done in that case ?

cc: @sfmskywalker @agriffard @VahidNaderi @mohdali

Originally posted by @Gupta-Krishnaa in #15

Wrong documentation for C# expressions

The documentation states that the output of an acticity can be retrieved by calling Output.From(string, string?). This leads to a compilation error stating that OutputProxy has no such method.

I took a look into the sourcecode and saw that the real method name is Output.Get(string, string?).

ConfigureRabbitMq delegate does not exist in rabbitMqFeature

The doc mentions rabbitMqFeature.ConfigureRabbitMq, but actualy there is no delegate named ConfigureRabbitMq, only one named ConfigureServiceBus.

It's easy to update the doc, but seems the right thing to do is to rename the delegate name from ConfigureServiceBus to ConfigureRabbitMq?
But this will be a break change.

Kindly confirm the right change to do here, then I will be happy to send a PR.

rabbitMqFeature => rabbitMqFeature.ConfigureRabbitMq = bus =>

Distributed Hosting

We need a topic about setting up Elsa on a distributed environment. This could be more general-purpose, with more specific configurations for targets like Kubernetes (#32).

Custom UI components

In a Discord support thread someone asked:

Hey guys, I am new to ELSA world. but i am wondering if we can create custom UI components (new web components, for example select/multiselect, interactive UI inputs) so we can provide the inputs in the designer itself. is this possible to add/alter the current activities to do such things?

or even write my custom components in a framework like react and inject them to be components in ELSA?

@sfmskywalker said that this already possible but not documented yet.

Create & Register workflows at runtime

We need a section about the ability to define a workflow from code and then register it with the runtime. For example:

// Define workflow.
var workflow = new Workflow(new Flowchart()) 
{ 
   Metadata = { DefinitionId = "MyDynamicWorkflow" }
   Name = "MyDynamicWorkflow" 
};

// Register workflow.
_runtime.register(workflow);

// Execute workflow.
_runtime.StartWorkflow("MyDynamicWorkflow", new StartWorkflowOptions());

Build & Deploy to Kubernetes

There should be an entire section that walks through the process of dockerizing an Elsa Server app and deploying it to a Kubernetes cluster.

Need demo on foreach

I need an tutorial on how to set an custon ActivityA that return an list of item, then foreach of then pass the value to Activities B and C.
I'm trying this, but without success

namespace CodeGeneratorWPF.Workflow
{
    public class CodeGenerationWorkflow : WorkflowBase
    {
        protected override ValueTask BuildAsync(IWorkflowBuilder builder, CancellationToken cancellationToken = default)
        {
            var currentValueVariable = new Variable<EntityDefinition>("current", new EntityDefinition());
            var entities = new Variable<List<EntityDefinition>>("entities", new List<EntityDefinition>());

            builder.Root = new Sequence
            {
                Variables = { currentValueVariable, entities },
                Activities =
                {
                    new GetEntityDefinitionStep()
                    {
                        InputContainerModel = new(entities)
                    },
                    new SetVariable
                    {
                        Variable = entities,
                        Value = new(context =>
                        {
                            return builder.Outputs.FirstOrDefault(x => x.Name == "entities");
                        })
                    },
                    new ForEach<EntityDefinition>((ICollection<EntityDefinition>)entities.Value){
                        CurrentValue = new Output<EntityDefinition>(currentValueVariable),
                        Body = new Sequence
                        {
                            Activities =
                            {
                                new NetCore_EntityFrameworkStep(currentValueVariable)
                                {
                                },
                                new WriteLine(context => $"Counter {currentValueVariable.Get(context)}")
                            }
                        }
                    }
                }
            };
            return ValueTask.CompletedTask;
        }
    }
}
public class GetEntityDefinitionStep : CodeActivityWithResult
{
    public Output<List<EntityDefinition>> OutputEntities { get; set; }
    public List<EntityDefinition> Entities { get; set; }
    public Input<List<string>> InputPathOfClasses { get; set; }
    public Input<ContainerModel> InputContainerModel { get; set; }
    public Output<ContainerModel> OutputContainerModel { get; set; }
    public Output<List<EntityDefinition>> OutputEntityDefinition { get; set; }
    public List<string> PathOfClasses { get; set; }
    class ClassInformatasdfion
    {
        public string Name { get; set; }
        public List<PropertyInfoasdfrmation> Properties { get; set; }
        public bool HasDecorator { get; set; }
        public string SystemType { get; set; }
    }
    class PropertyInfoasdfrmation
    {
        public string Name { get; set; }
        public string Type { get; set; }
        public List<string> Decorators { get; set; } = new List<string>();
    }
    //public GetEntityDefinitionStep(Variable<List<string>> pathOfClasses)
    //{
    //    InputPathOfClasses = new(pathOfClasses);
    //}
    protected override async ValueTask ExecuteAsync(ActivityExecutionContext context)
    {
        Console.WriteLine("BEGIN - " + this.GetType().Name);
        //var a = InputPathOfClasses.Get(context);
        var containerModel = context.WorkflowInput.FirstOrDefault(x => x.Key == "container").Value;
        var container = GetEntityDefinition(containerModel as ContainerModel);
        Console.WriteLine("END - " + this.GetType().Name);
        //Result.SetPropertyValue("entities", container.Entities);
        OutputContainerModel.Set(context, new Variable<ContainerModel>(container));
        OutputEntityDefinition.Set(context, new Variable<List<EntityDefinition>>(container.Entities));
        context.SetVariable("entities", container.Entities);
    }
}

API Admin Key Creation

There seems to be a discrepancy between the documentation and the actual behavior of the system. When following the steps outlined in the Elsa-Server documentation to set up an Elsa server, the step to create a new admin results in a 401 Unauthorized error. This is unexpected as the documentation mentions that requests from localhost should be allowed.

The request in question is:

curl --location 'https://localhost:5001/elsa/api/identity/applications' \\
--header 'Content-Type: application/json' \\
--data '{
    "name": "Postman",
    "roles": ["admin"]
}'

Additionally, the provided Program.cs configuration is as follows:

using Elsa.Extensions;
using osisa.SmartWeb2.Api.Workflows;

var builder = WebApplication.CreateBuilder(args);

// Add services to the container.
builder.Services.AddControllers();
builder.Services.AddElsa(elsa => 
    elsa
        // Configure identity so that we can create a default admin user.
        .UseIdentity(identity =>
        {
            var configuration = builder.Configuration;
            var identitySection = configuration.GetSection("Identity");
            var identityTokenSection = identitySection.GetSection("Tokens");

            identity.IdentityOptions = options => identitySection.Bind(options);
            identity.TokenOptions = options => identityTokenSection.Bind(options);
            identity.UseConfigurationBasedUserProvider(options => identitySection.Bind(options));
            identity.UseConfigurationBasedApplicationProvider(options => identitySection.Bind(options));
            identity.UseConfigurationBasedRoleProvider(options => identitySection.Bind(options));
        })

        // Use default authentication (JWT + API Key).
        .UseDefaultAuthentication(auth => auth.UseAdminApiKey())

        // EXPOSE API ENDPOINTS
        .UseWorkflowsApi()

        // REGISTER WORKFLOWS AS HTTP ENDPOINTS under /workflows/{name}
        .UseWorkflowRuntime(
            runtime => runtime
                .AddWorkflow<HelloWorldHttpWorkflow>())
        .UseHttp()
    );

// Configure CORS to allow designer app hosted on a different origin to invoke the APIs.
builder.Services.AddCors(cors => cors.AddDefaultPolicy(policy => policy.AllowAnyOrigin().AllowAnyHeader().AllowAnyMethod()));


var app = builder.Build();

// Configure the HTTP request pipeline.
app.UseHttpsRedirection();
app.UseAuthorization();
// ENABLE CORS
app.UseCors();
// ENABLE AUTHENTICATION
app.UseAuthentication();
// ENABLE WORKFLOWS API
app.UseWorkflowsApi();
// REGISTER CONTROLLERS AS HTTP ENDPOINTS
app.MapControllers();
// ENABLE WORKFLOWS TO BE USED AS HTTP ENDPOINTS
app.UseWorkflows();
app.Run();

It would be beneficial for users if the documentation could be updated to reflect the correct steps or provide additional troubleshooting steps for this issue.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.