Skip to content

A Python framework for dynamically crafting and managing multi-step API workflows with conditional logic and user prompts.

Notifications You must be signed in to change notification settings

m0nirul/interaction-fabric

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

interaction-fabric

A Python framework for dynamically crafting and managing multi-step API workflows with conditional logic and user prompts.

Features

  • Visual and code-based workflow designer supporting conditional branching
  • Real-time API chaining and data aggregation
  • Built-in user prompt system allowing external data or decisions to modulate workflow execution

Installation

pip install -e .

Quick Start

from interaction_fabric.workflow import Workflow
from interaction_fabric.api_client import APIClient
from interaction_fabric.prompts import UserPrompt

api_client = APIClient()

workflow = Workflow([
    {
        'step': 'get_user',
        'action': lambda ctx: api_client.get('/users', params={'id': ctx['user_id']}),
        'next': lambda result, ctx: 'ask_continue' if result['active'] else 'end',
    },
    {
        'step': 'ask_continue',
        'action': lambda ctx: UserPrompt.ask('Continue with workflow?'),
        'next': lambda result, ctx: 'process_data' if result else 'end',
    },
    {
        'step': 'process_data',
        'action': lambda ctx: api_client.post('/process', json=ctx['user_data']),
        'next': 'end',
    },
    {
        'step': 'end',
        'action': lambda ctx: print('Workflow ended'),
    }
])

workflow.run({'user_id': 42})

Workflow Designer (Visual)

To launch the visual workflow designer:

from interaction_fabric.visualizer import launch_designer

launch_designer()

You can drag and drop steps, define conditional branches, and preview real-time execution.

Documentation

Contributing

Feel free to open issues or submit PRs for bugs, features, or improvements.

About

A Python framework for dynamically crafting and managing multi-step API workflows with conditional logic and user prompts.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages