"""Create fallback_executor
Generated by Phi-Octopus Eden
2025-11-08 11:11:13.388865
"""

```python
class FallbackExecutor:
    """
    A class for creating a fallback mechanism in execution flow.

    This class helps in implementing a robust error handling strategy by executing a primary function first,
    and if it fails or returns an unsatisfactory result, it falls back to one or more secondary functions.
    """

    def __init__(self, primary_function: callable, fallback_functions: list[callable], *args, **kwargs):
        """
        Initialize the FallbackExecutor.

        :param primary_function: The main function to be executed first.
        :param fallback_functions: A list of functions that will be tried in order if the primary function fails.
        :param args: Additional arguments for the functions.
        :param kwargs: Additional keyword arguments for the functions.
        """
        self.primary_function = primary_function
        self.fallback_functions = fallback_functions
        self.args = args
        self.kwargs = kwargs

    def execute(self) -> any:
        """
        Execute the primary function and fallback to secondary functions if necessary.

        :return: The result of the successful execution.
        """
        try:
            return self.primary_function(*self.args, **self.kwargs)
        except Exception as e:
            for func in self.fallback_functions:
                try:
                    return func(*self.args, **self.kwargs)
                except Exception as fallback_e:
                    continue
            raise RuntimeError("All functions failed") from e

# Example usage:
def primary_greet(name: str) -> str:
    """Primary function to greet."""
    if not name.isalpha():
        raise ValueError("Invalid name")
    return f"Hello, {name}!"

def secondary_greet(name: str) -> str:
    """Fallback function 1 to greet."""
    return "Greetings! Who are you?"

def tertiary_greet(name: str) -> str:
    """Fallback function 2 to greet."""
    return "Salutations! Stranger!"

# Creating the FallbackExecutor instance
fallback_executor = FallbackExecutor(primary_function=primary_greet,
                                     fallback_functions=[secondary_greet, tertiary_greet],
                                     name="guest")

try:
    print(fallback_executor.execute())  # This should succeed as the name is valid.
except Exception as e:
    print(e)

# Example with an invalid name
try:
    print(fallback_executor.execute(name="123!"))  # This should trigger fallback execution.
except Exception as e:
    print(e)
```